Docker image with compiled Dlib and Node.js
Based on dlib image
- node - 10.3.0
- dlib - 19.8
- opencv - 3.4.1
If you want to use some native modules you'll need to install at least python
.
So you can add following lines to your dockerfile.
For alpine you will also need libstdc++
for building native modules.
RUN apk add --virtual .build-deps python libstdc++ gcc g++ make
Also you may need libc6-compat
if your native modules will use glibc.
After bould you may want ot delete build deps in order to reduce image size.
RUN apk del .build-deps
Remember: you'll need to delete them in one layer with adding them or use
--squash
to reduce actual size.
RUN apt-get update && apt-get install -y --no-install-recommends python build-essential
- face-recognition - native module, see installing instructions above and follow module documentation.
FROM m03geek/opencv-dlib-node:alpine
RUN apk update && apk add -u python make g++ libpng-dev libjpeg-turbo-dev giflib-dev libx11-dev
RUN npm init -y
RUN npm i face-recognition
In order to add ffmpeg support just simply install it through package manager
RUN apk add -u --no-cache ffmpeg
# optioanlly export ffmpeg binaries to env (e.g. for fluent-ffmpeg module)
ENV FFMPEG_PATH='/usr/bin/ffmpeg' \
FFPROBE_PATH='/usr/bin/ffprobe'
You may install ffmpeg from official repo, but I'd recommend deb-multimedia.
RUN echo "deb http://www.deb-multimedia.org stretch main non-free" >> "/etc/apt/sources.list" \
&& apt-get update && apt-get install -y deb-multimedia-keyring ffmpeg --no-install-recommends --allow-unauthenticated
# optioanlly export ffmpeg binaries to env (e.g. for fluent-ffmpeg module)
ENV FFMPEG_PATH='/usr/bin/ffmpeg' \
FFPROBE_PATH='/usr/bin/ffprobe'
OpenCV | Dlib | OpenCV+Dlib | OpenCV+Dlib+Node.js | OpenCV+Node.js | Dlib+Node.js |
---|---|---|---|---|---|
Docker | Docker | Docker | Docker | Docker | Docker |
Github | Github | Github | Github | Github | Github |
OpenCV | OpenCV+Dlib | OpenCV+Dlib+Node.js | OpenCV+Node.js |
---|---|---|---|
Docker | Docker | Docker | Docker |
Github | Github | Github | Github |