urielch/opencv-nodejs

By urielch

Updated over 3 years ago

opencv-nodejs Prebuild image base.

Image
0

3.8K

urielch/opencv-nodejs repository overview

This image contains a prebuilt version of @u4/opencv4nodejs.

create your image from urielch/opencv-nodejs, then use @u4/opencv4nodejs directly.

This image is published for ARM64 and AMD64, so it can be used on an Apple M1, AWS graviton, and a 64 Bit raspberry pi.

Working dockerfile sample of a NestJS application using opencv-nodejs

FROM urielch/opencv-nodejs:6.2.4 As build
WORKDIR /usr/src/app
ENV NODE_ENV=development
RUN npm install -g rimraf @nestjs/cli
COPY package*.json tsconfig.* ./
# should be quick after a ci
RUN npm remove @u4/opencv4nodejs
# will create the package-lock.json
RUN npm install --force
# create sym links, longest step
RUN npm link @u4/opencv4nodejs
COPY src ./src
RUN npm run build
# cleanup to reduce final image size
RUN rimraf src
RUN rimraf node_modules/**/*.{md,ts,map,h,c,cc,cpp,gyp,yml,txt}
RUN rimraf node_modules/{types,@eslint}
RUN rimraf node_modules/**/{LICENSE,.github,.npmignore,LICENSE.txt,.travis.yml,.eslintrc,sponsors}
RUN rimraf node_modules/*/{test,binding.gyp}
RUN rimraf dist/**/{*.map,*.ts}
RUN find . -type f -empty -print -delete
RUN find . -type d -empty -print -delete

FROM urielch/opencv-nodejs:6.2.4 As production
ARG NODE_ENV=production
ENV NODE_ENV=production
WORKDIR /usr/src/app
# add my extra stuff
COPY resources ./resources
COPY img ./img
COPY --from=build /usr/src/app /usr/src/app
CMD ["node", "dist/main"]

Tag summary

Content type

Image

Digest

sha256:ce0ab4d70

Size

86.5 MB

Last updated

over 3 years ago

Requires Docker Desktop 4.37.1 or later.