version: "3.8" services: jupyter-server: image: dl-jupyter init: true build: context: ./ dockerfile: jupyter.Dockerfile shm_size: '2gb' env_file: ./.env ports: - ${JUPYTER_PORT}:${JUPYTER_PORT} volumes: - ${ROOT_DIR}:/jupyter - ${DATA_DIR}:/jupyter/datasets environment: - NVIDIA_VISIBLE_DEVICES=all command: [ "jupyter", "notebook", "--ip=*", "--port=${JUPYTER_PORT}", "--allow-root", "--notebook-dir=${JUPYTER_DIR}", '--NotebookApp.token=${JUPYTER_TOKEN}' ] deploy: restart_policy: condition: any resources: reservations: devices: - 'driver': 'nvidia' 'count': 1 'capabilities': ['gpu', 'utility', 'compute']