Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
63 lines (59 loc) · 1.96 KB
/
Copy pathdocker-compose.yml
File metadata and controls
63 lines (59 loc) · 1.96 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
services:
postgres:
image: postgres:16
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: rulegraph
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
# ── FastAPI backend ────────────────────────────────────────────────────────
# Runs Alembic migrations, then serves the API on :8000.
backend:
build: .
command: sh -c "alembic upgrade head && uvicorn app.main:app --host 0.0.0.0 --port 8000"
env_file: .env
# Inside the compose network the DB/Redis hosts are the service names, not
# localhost — override whatever .env points at for host runs.
environment:
DATABASE_URL: postgresql+asyncpg://postgres:postgres@postgres:5432/rulegraph
REDIS_URL: redis://redis:6379
ports:
- "8000:8000"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
# ── arq ingest worker ──────────────────────────────────────────────────────
# Runs source ingest jobs out-of-process so they survive a uvicorn restart.
worker:
build: .
command: arq app.tasks.worker.WorkerSettings
env_file: .env
environment:
DATABASE_URL: postgresql+asyncpg://postgres:postgres@postgres:5432/rulegraph
REDIS_URL: redis://redis:6379
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
volumes:
postgres_data: