-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.yaml
51 lines (50 loc) · 1.8 KB
/
compose.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: "opencv-projects"
services:
jupyter:
image: "opencv-projects:latest"
build:
context: "./infra/image"
dockerfile: "./jupyter/Containerfile"
container_name: "opencv-projects"
user: "root"
environment:
NB_USER: "opencv"
CHOWN_HOME: "yes"
TERM: "linux"
# When using X Window System, by default the DISPLAY variable is set such
# that X clients (i.e. GUI programs) connect to the local X server via
# unix domain socket, located at /tmp/.X11-unix/Xn, where n is X server
# number
DISPLAY: "${DISPLAY}"
working_dir: "/home/opencv"
ports:
- "8888:8888"
volumes:
- "./infra/image/jupyter/settings/overrides:/opt/conda/share/jupyter/lab/settings"
- "./infra/image/jupyter/settings/config:/usr/local/etc/jupyter"
- "./infra/image/jupyter/scripts:/home/opencv/scripts"
- "./src:/home/opencv/workdir"
# This allows X clients, i.e. programs that display their GUI to X
# server, such as when displaying GUI windows with OpenCV, to connect to
# the X server running on the host. This way the windows will be
# displayed on the machine running the container.
# Make sure you have authorized opencv group via xhost locally:
# $ xhost +si:localgroup:opencv
- "/tmp/.X11-unix:/tmp/.X11-unix"
# Pass your webcam here
# devices:
# - "/dev/video0"
# https://jupyter-docker-stacks.readthedocs.io/en/latest/using/running.html#example-2
command: >-2
start-notebook.py
--ServerApp.root_dir=/home/opencv/workdir
--IdentityProvider.token='opencv'
deploy:
resources:
reservations:
devices:
- capabilities:
- "compute"
- "utility"
driver: "nvidia"
count: "all"