Docker image for NodeJS with OpenCV
- In your shell:
docker pull mgcrea/node-opencv:2.4.12
docker run --name test_opencv -it mgcrea/node-opencv:2.4.12 /bin/bash
- In your
Dockerfile
:
FROM mgcrea/node-opencv:2.4.12
# https://docs.docker.com/compose/yml/
version: '2'
services:
backend:
image: mgcrea/node-opencv:2.4.12
container_name: test_opencv
command: "node lib"
# command: "/usr/local/bin/npm install --verbose"
working_dir: /srv/node
environment:
- LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/opencv/build/lib
- NODE_ENV=production
expose:
- "3000"
volumes:
- .:/srv/node
- /usr/lib/beignet:/usr/lib/beignet:ro
devices:
- "/dev/video0:/dev/video0"
- "/dev/dri/card0:/dev/dri/card0"
docker-compose up -d
You can find the latest available tags at hub.docker.com
mgcrea/node-opencv:2
mgcrea/node-opencv:2.4
mgcrea/node-opencv:2.4.12
mgcrea/node-opencv:2.4.12.3