Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
115 lines (112 loc) · 3.18 KB
/
Copy pathdocker-compose.yml
File metadata and controls
115 lines (112 loc) · 3.18 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
---
services:
peering-manager:
&peering-manager
image: docker.io/peeringmanager/peering-manager:${VERSION-snapshot}
depends_on:
- postgres
- redis
- redis-cache
env_file: env/peering-manager.env
user: "unit:root"
healthcheck:
test: /opt/peering-manager/healthcheck.sh
start_period: 240s # Allow migrations to run, some can be expensive
timeout: 3s
interval: 15s
volumes:
- ./configuration:/etc/peering-manager/config:z,ro
rqworker:
<<: *peering-manager
depends_on:
peering-manager:
condition: service_healthy
command:
- /opt/peering-manager/venv/bin/python
- /opt/peering-manager/manage.py
- rqworker
healthcheck:
test: ["CMD", "pgrep", "-f", "rqworker"]
start_period: 20s
timeout: 3s
interval: 15s
# As of 1.11 the rqworker runs these two tasks itself, on a schedule managed
# in Admin > Scheduled Tasks. The services below serve an external scheduler
# instead: disable the tasks there, then start this profile.
housekeeping:
<<: *peering-manager
profiles:
- external-scheduler
environment:
COMMAND_INTERVAL: 86400
depends_on:
peering-manager:
condition: service_healthy
command:
- /opt/peering-manager/run-command.sh
- housekeeping
healthcheck:
test: ["CMD", "pgrep", "-f", "housekeeping"]
start_period: 20s
timeout: 3s
interval: 15s
peeringdb-sync:
<<: *peering-manager
profiles:
- external-scheduler
environment:
COMMAND_INTERVAL: 86400
depends_on:
peering-manager:
condition: service_healthy
command:
- /opt/peering-manager/run-command.sh
- peeringdb_sync
healthcheck:
test: ["CMD", "pgrep", "-f", "peeringdb_sync"]
start_period: 20s
timeout: 3s
interval: 15s
postgres:
image: docker.io/postgres:18-alpine
healthcheck:
test: pg_isready -q -t 2 -d $$POSTGRES_DB -U $$POSTGRES_USER
start_period: 20s
timeout: 30s
interval: 10s
retries: 5
env_file: env/postgres.env
volumes:
- peeringmanager-postgres-data:/var/lib/postgresql
redis:
image: docker.io/valkey/valkey:9-alpine
command:
- sh
- -c # this is to evaluate the $REDIS_PASSWORD from the env
- valkey-server --appendonly yes --requirepass $$REDIS_PASSWORD ## $$ because of docker-compose
healthcheck: &redis-healthcheck
test: '[ $$(valkey-cli --pass "$${REDIS_PASSWORD}" ping) = ''PONG'' ]'
start_period: 5s
timeout: 3s
interval: 1s
retries: 5
env_file: env/redis.env
volumes:
- peeringmanager-redis-data:/data
redis-cache:
image: docker.io/valkey/valkey:9-alpine
command:
- sh
- -c # this is to evaluate the $REDIS_PASSWORD from the env
- valkey-server --requirepass $$REDIS_PASSWORD ## $$ because of docker-compose
healthcheck: *redis-healthcheck
env_file: env/redis-cache.env
volumes:
- peeringmanager-redis-cache-data:/data
volumes:
peeringmanager-postgres-data:
driver: local
peeringmanager-redis-cache-data:
driver: local
peeringmanager-redis-data:
driver: local