-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
45 lines (36 loc) · 1.4 KB
/
docker-compose.yml
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
version: "3"
# Usefull links to understand how this works
# NVIDIA Docker: GPU Server Application Deployment Made Easy: https://developer.nvidia.com/blog/nvidia-docker-gpu-server-application-deployment-made-easy/
# Tensorflow docker: https://www.tensorflow.org/install/docker
# In order to "runtime: nvidia work", is necessary an updated docker-compose v1.27.4
# To verify if you can use GPU: https://www.tensorflow.org/guide/gpu
# Extra: Learn how to do multi-stage builds: https://docs.docker.com/develop/develop-images/multistage-build/
# Extra: docker save: https://docs.docker.com/engine/reference/commandline/save/
# Extra: docker load: https://docs.docker.com/engine/reference/commandline/load/
services: # containers
tensorflow-gpu:
runtime: nvidia
environment:
- NVIDIA_VISIBLE_DEVICES=all
build:
# Changes the current folder for docker-compose
context: .
dockerfile: ./Dockerfile
args:
- username=crispa
- userid=1000
container_name: tf-gpu
image: tf-gpu
# Restart policies
restart: unless-stopped
# Logging configuration for the service
logging:
driver: json-file
options:
max-size: 50m
ports:
- "8888:8888"
- "6006:6006"
volumes:
- ./handson-ml2/:/home/crispa/src/
command: /opt/conda/envs/tf-gpu/bin/jupyter-lab --ip='0.0.0.0' --port=8888 --no-browser