-
Notifications
You must be signed in to change notification settings - Fork 7
/
docker-compose.yml
98 lines (96 loc) · 2.81 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
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
98
services:
postgres:
restart: always
image: postgres
environment:
POSTGRES_PASSWORD: "changeme_metropolis_password"
POSTGRES_USER: "metropolis_superuser"
POSTGRES_DB: "metropolis"
# TODO: load secrets from files?
# TODO: backup-on-start?
volumes:
- ${PWD}/postgres-init-db.sh:/docker-entrypoint-initdb.d/postgres-init-db.sh
#- '${PWD}/pg_dump_2023-12-23.sql.gz:/pg_dump.sql.gz'
- postgres-data:/var/lib/postgresql/data
networks:
- postgres
healthcheck:
test: ["CMD", "bash", "-c", "PGPASSWORD=changeme_metropolis_password psql -U metropolis_superuser metropolis"]
interval: 10s
timeout: 60s
gunicorn:
restart: always
image: ghcr.io/wlmac/metropolis
build: .
command: /app/docker_entrypoint.sh gunicorn
entrypoint: bash
environment:
METROPOLIS_AUTOSETUP: "yes"
ports:
- "0.0.0.0:28780:28780" # force only IPv4 (only have iptables rules on IPv4)
depends_on:
postgres:
condition: service_healthy
networks:
- postgres
- gunicorn
- redis
volumes:
- ${PWD}/metropolis/local_settings.py:/app-inject/metropolis/docker_local_settings.py:ro # changed to /metropolis2/ on server
- ${PWD}/metropolis/local_rsa_privkey.pem:/app-inject/metropolis/local_rsa_privkey.pem:ro # see above for all other references.
- public:/app-public:rw
- media:/app-media:rw
celery:
restart: always
image: ghcr.io/wlmac/metropolis
build: .
command: /app/docker_entrypoint.sh celery
entrypoint: bash
depends_on:
postgres:
condition: service_healthy
networks:
- postgres
- redis
volumes:
- ${PWD}/metropolis/local_settings.py:/app-inject/metropolis/docker_local_settings.py:ro
- ${PWD}/metropolis/local_rsa_privkey.pem:/app-inject/metropolis/local_rsa_privkey.pem:ro
celery-beat:
restart: always
image: ghcr.io/wlmac/metropolis
build: .
command: /app/docker_entrypoint.sh as-app /app/.venv/bin/celery -A metropolis beat --loglevel=INFO
entrypoint: bash
depends_on:
postgres:
condition: service_healthy
networks:
- postgres
- redis
volumes:
- ${PWD}/metropolis/local_settings.py:/app-inject/metropolis/docker_local_settings.py:ro
- ${PWD}/metropolis/local_rsa_privkey.pem:/app-inject/metropolis/local_rsa_privkey.pem:ro
redis:
restart: always
image: redis
networks:
- redis
volumes:
public:
driver: local
driver_opts:
type: none
o: bind
device: '/srv2/app/static'
media:
driver: local
driver_opts:
type: none
o: bind
device: '/srv2/app/media'
static2:
postgres-data:
networks:
gunicorn: # gunicorn <-> caddy
redis: # redis <-> gunicorn
postgres: # postgres <-> gunicorn