-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
92 lines (92 loc) · 2.33 KB
/
docker-compose.yml
File metadata and controls
92 lines (92 loc) · 2.33 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
services:
db:
image: postgres:16-alpine
volumes:
- pgdata:/var/lib/postgresql/data
ports:
- "5432:5432"
environment:
- POSTGRES_HOST_AUTH_METHOD=trust
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
pulse:
image: rabbitmq:3.12.1-management-alpine
environment:
- RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS=-rabbit loopback_users []
- RABBITMQ_DEFAULT_USER=guest
- RABBITMQ_DEFAULT_PASS=guest
- RABBITMQ_DEFAULT_VHOST=/
ports:
- "5672:5672"
- "15672:15672"
healthcheck:
test: rabbitmq-diagnostics ping
interval: 3s
timeout: 4s
retries: 100
start_period: 3s
db-init:
image: pulseguardian-base:latest
build:
context: ./
dockerfile: ./docker/Dockerfile
volumes:
- ./:/code
- db-init-marker:/db-init
depends_on:
db:
condition: service_healthy
environment:
- DATABASE_URL=postgresql://postgres@db/postgres
command: >
sh -c '
if [ ! -f /db-init/.initialized ]; then
echo "Initializing database...";
python pulseguardian/dbinit.py && touch /db-init/.initialized;
echo "Database initialized successfully";
else
echo "Database already initialized, skipping...";
fi
'
pulseguardian-web:
image: pulseguardian-base:latest
build:
context: ./
dockerfile: ./docker/Dockerfile
ports:
- "5000:5000"
volumes:
- ./:/code
depends_on:
db-init:
condition: service_completed_successfully
pulse:
condition: service_healthy
environment:
- FAKE_ACCOUNT=fake@example.com
- FLASK_DEBUG_MODE=1
- FLASK_HOST=pulseguardian-web
- FLASK_USE_SSL=0
- DATABASE_URL=postgresql://postgres@db/postgres
command: ["python", "pulseguardian/web.py"]
pulseguardian-guardian:
image: pulseguardian-base:latest
build:
context: ./
dockerfile: ./docker/Dockerfile
volumes:
- ./:/code
depends_on:
db-init:
condition: service_completed_successfully
pulse:
condition: service_healthy
environment:
- DATABASE_URL=postgresql://postgres@db/postgres
command: ["python", "pulseguardian/guardian.py"]
volumes:
pgdata:
db-init-marker: