-
Notifications
You must be signed in to change notification settings - Fork 18
/
docker-compose.prod.yml
57 lines (55 loc) · 2.24 KB
/
docker-compose.prod.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
46
47
48
49
50
51
52
53
54
55
56
57
# should be used together with docker-compose.yml for production development
# docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
version: "3.2"
services:
opentpod-nginx:
container_name: opentpod-nginx
image: nginx:latest
restart: always
ports:
- 0.0.0.0:20000:80
volumes:
- ./nginx/opentpod.conf:/etc/nginx/conf.d/default.conf:ro
- opentpod-www-static:/var/www/static
- opentpod-data-var:/var/lib/openTPOD
depends_on:
- opentpod
opentpod:
command: [ "./run-frontend.sh" ]
restart: always
volumes:
- opentpod-www-static:/root/openTPOD/static
opentpod-worker: &opentpod-worker
command: [ "./run-worker.sh", "default" ]
restart: always
# copied from docker-compose.yml because yaml anchors don't work across files
image: opentpod:stable
volumes:
- opentpod-data-var:/root/openTPOD/var
environment:
- DJANGO_ALLOWED_HOSTS
- DJANGO_SECRET_KEY
- DJANGO_DEBUG=false
- PYTHONDONTWRITEBYTECODE=1
- REDIS_URL=redis://:${OPENTPOD_REDIS_PASSWORD}@opentpod-redis:6379/0
- CACHE_URL=redis://:${OPENTPOD_REDIS_PASSWORD}@opentpod-redis:6379/1
- DATABASE_URL=postgres://root:${OPENTPOD_DB_PASSWORD}@opentpod-db:5432/opentpod
# should be only for nvidia workers, but anchors don't seem to merge these lists
- NVIDIA_VISIBLE_DEVICES=all # needed for cuda devices to be visible
- NVIDIA_DRIVER_CAPABILITIES=compute,utility
depends_on:
- opentpod-db
- opentpod-redis
opentpod-trainer:
<<: *opentpod-worker
container_name: opentpod-trainer
command: [ "./run-worker.sh", "low" ]
#environment:
# - NVIDIA_VISIBLE_DEVICES=all # needed for cuda devices to be visible
# - NVIDIA_DRIVER_CAPABILITIES=compute,utility
opentpod-rqscheduler:
<<: *opentpod-worker
container_name: opentpod-rqscheduler
command: [ "bash", "-c", "rqscheduler --host=opentpod-redis --port=6379 --db=0 --password=${OPENTPOD_REDIS_PASSWORD}" ]
volumes:
opentpod-www-static: