-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
95 lines (89 loc) · 2.91 KB
/
docker-compose.prod.yml
File metadata and controls
95 lines (89 loc) · 2.91 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
version: "3.9"
services:
# ─── PostgreSQL ──────────────────────────────────────────────────
db:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_USER: helios
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-helios_secure_pw}
POSTGRES_DB: helios
volumes:
- pgdata:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U helios"]
interval: 10s
timeout: 5s
retries: 5
# ─── Redis ───────────────────────────────────────────────────────
redis:
image: redis:7-alpine
restart: unless-stopped
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
# ─── Helios API (Flask + Gunicorn) ──────────────────────────────
web:
build: .
restart: unless-stopped
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
ports:
- "5050:5050"
env_file:
- .env.production
environment:
HELIOS_ENV: production
HELIOS_DEBUG: "false"
HELIOS_DATABASE_URL: postgresql://helios:${POSTGRES_PASSWORD:-helios_secure_pw}@db:5432/helios
HELIOS_REDIS_URL: redis://redis:6379/0
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5050/health"]
interval: 30s
timeout: 5s
retries: 3
# ─── Celery Worker (Background Jobs) ────────────────────────────
worker:
build: .
restart: unless-stopped
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
env_file:
- .env.production
environment:
HELIOS_ENV: production
HELIOS_DEBUG: "false"
HELIOS_DATABASE_URL: postgresql://helios:${POSTGRES_PASSWORD:-helios_secure_pw}@db:5432/helios
HELIOS_REDIS_URL: redis://redis:6379/0
command: celery -A celery_app worker --loglevel=info --concurrency=2
# ─── Celery Beat (Scheduler) ────────────────────────────────────
beat:
build: .
restart: unless-stopped
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
env_file:
- .env.production
environment:
HELIOS_ENV: production
HELIOS_DEBUG: "false"
HELIOS_DATABASE_URL: postgresql://helios:${POSTGRES_PASSWORD:-helios_secure_pw}@db:5432/helios
HELIOS_REDIS_URL: redis://redis:6379/0
command: celery -A celery_app beat --loglevel=info
volumes:
pgdata: