-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
executable file
·97 lines (90 loc) · 3.1 KB
/
docker-compose.yaml
File metadata and controls
executable file
·97 lines (90 loc) · 3.1 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
services:
db:
image: postgis/postgis:16-3.4
container_name: planpincieux-db
restart: unless-stopped
environment:
POSTGRES_DB: ${DB_NAME:-planpincieux}
POSTGRES_USER: ${DB_USER:-postgres}
volumes:
- db_data:/var/lib/postgresql/data
networks: [ppcx_net]
ports:
- "5434:5432" # host_port:container_port
secrets:
- db_password
web:
build:
context: .
dockerfile: Dockerfile
container_name: planpincieux-web
restart: unless-stopped
# For developing
command: python manage.py runserver 0.0.0.0:8000
# For production (use gunicorn)
# command: sh -c 'gunicorn planpincieux.wsgi:application -b 0.0.0.0:8000 -w ${GUNICORN_WORKERS:-3} --access-logfile - --error-logfile -'
depends_on: [db]
environment:
DB_HOST: ${DB_HOST:-db}
DB_PORT: ${DB_PORT:-5432}
DB_NAME: ${DB_NAME:-planpincieux}
DB_USER: ${DB_USER:-postgres}
DB_PASSWORD_FILE: /run/secrets/db_password # provided via Docker secret
SECRET_KEY_FILE: /run/secrets/django_secret_key # provided via Docker secret
DJANGO_SETTINGS_MODULE: ${DJANGO_SETTINGS_MODULE:-planpincieux.settings}
ALLOWED_HOSTS: ${ALLOWED_HOSTS:-localhost,127.0.0.1,0.0.0.0,150.145.51.193,100.93.90.61}
DEBUG: ${DEBUG:-True}
GUNICORN_WORKERS: "${GUNICORN_WORKERS:-4}"
volumes:
- ./app:/ppcx/app:rw # Used to edit code on host and directly see changes in container. Not needed in production.
- dic_data:/ppcx/data:rw # Persistent volume to store h5 DIC data # TODO: move to /data/dic_data for consistency
- ppcx_data:/data/ppcx_data:ro # Read-only mount of GMG FTP datax
- fms_data:/data/fms_data:ro # Read-only mount of FMS data # NOTE: moved to /data/fms_data for consistency # TODO: change path in code
ports:
- "8080:8000" # For production with gunicorn
- "9999:9999" # For developing with runserver and debug with vscode
networks: [ppcx_net]
secrets:
- db_password
- django_secret_key
tsexplore:
build:
context: ./tsexplore_app
dockerfile: Dockerfile
container_name: tsexplore
restart: unless-stopped
environment:
DATA_DIR: /ppcx/data
# use the project environment stored outside /app so mounted source won't break it
UV_PROJECT_ENVIRONMENT: /opt/.venv
volumes:
- ./tsexplore_app:/app:rw # allow live edits in container
- dic_data:/ppcx/data:ro # share dataset volume used by Django
ports:
- "8002:8000" # make TS app available on host:8002 (8001 is already reserved in the host by CVAT)
depends_on:
- db
- web
networks:
- ppcx_net
volumes:
db_data:
dic_data:
ppcx_data:
driver_opts:
type: none
device: /home/fioli/storage/GMG_ftp/Dati/Planpincieux
o: bind
fms_data:
driver_opts:
type: none
device: /home/fioli/storage/fms
o: bind
networks:
ppcx_net:
driver: bridge
secrets:
db_password:
file: ${DB_SECRET_FILE:-~/secrets/db_password}
django_secret_key:
file: ${DJANGO_SECRET_KEY_FILE:-~/secrets/django_secret_key}