-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
94 lines (87 loc) · 2.18 KB
/
Copy pathdocker-compose.yml
File metadata and controls
94 lines (87 loc) · 2.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
services:
migrations:
build: .
volumes:
- ./config:/app/config:ro
environment:
DATABASE_URL: postgresql+psycopg2://simdb:simdb@postgres:5432/simdb
depends_on:
- postgres
command: uv run alembic upgrade head
restart: "no"
web:
build: .
ports:
- "5000:5000"
volumes:
- ./validation:/app/validation:ro
- ./config:/app/config:ro
- ./tmp/partition_data:/data/simdb/partition:ro
- ./upload_folder:/data/simdb/simulations
depends_on:
redis:
condition: service_healthy
postgres:
condition: service_healthy
migrations:
condition: service_completed_successfully
restart: unless-stopped
worker:
profiles: [with_workers]
# docker compose --profile with_workers enables this service
build: .
command: uv run simdb_worker
volumes:
- ./config:/app/config:ro
- ./tmp/partition_data:/data/simdb/partition:ro
- ./upload_folder:/data/simdb/simulations
depends_on:
redis:
condition: service_healthy
postgres:
condition: service_healthy
migrations:
condition: service_completed_successfully
restart: unless-stopped
beat:
profiles: [with_workers]
# docker compose --profile with_workers enables this service
build: .
command: uv run simdb_beat
volumes:
- ./config:/app/config:ro
depends_on:
redis:
condition: service_healthy
postgres:
condition: service_healthy
migrations:
condition: service_completed_successfully
restart: unless-stopped
redis:
image: redis:8-alpine
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 1s
timeout: 5s
retries: 5
restart: unless-stopped
postgres:
image: postgres:16-alpine
environment:
- POSTGRES_USER=simdb
- POSTGRES_PASSWORD=simdb
- POSTGRES_DB=simdb
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U simdb"]
interval: 1s
timeout: 5s
retries: 5
restart: unless-stopped
volumes:
redis_data:
postgres_data: