-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
86 lines (80 loc) · 3.06 KB
/
Copy pathdocker-compose.yml
File metadata and controls
86 lines (80 loc) · 3.06 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
services:
# ── PostgreSQL ────────────────────────────────────────────────────────────
postgres:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_USER: churnai
POSTGRES_PASSWORD: churnai
POSTGRES_DB: churnai
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U churnai"]
interval: 10s
timeout: 5s
retries: 5
# ── Redis (cache) ─────────────────────────────────────────────────────────
redis:
image: redis:7-alpine
restart: unless-stopped
ports:
- "6379:6379"
# ── Backend (FastAPI + Agents) ────────────────────────────────────────────
backend:
# `backend` and `worker` run the SAME code, so they share one image tag:
# rebuilding either keeps them in lockstep (a drifting worker image once
# dead-lettered jobs with a missing dependency).
image: churnai-backend:dev
build:
context: ./backend
dockerfile: Dockerfile
restart: unless-stopped
env_file: ./backend/.env
environment:
DATABASE_URL: postgresql+asyncpg://churnai:churnai@postgres:5432/churnai
REDIS_URL: redis://redis:6379/0
ports:
- "8001:8000"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_started
volumes:
- ./backend:/app
command: uvicorn main:app --host 0.0.0.0 --port 8000 --reload
# ── Worker (Arq async jobs) ───────────────────────────────────────────────
# Opt-in: the keyless demo runs without it (synchronous endpoints). Scales
# independently; aligned with the Kubernetes deployment target.
worker:
image: churnai-backend:dev # same image as `backend` (see note above)
build:
context: ./backend
dockerfile: Dockerfile
restart: unless-stopped
env_file: ./backend/.env
environment:
DATABASE_URL: postgresql+asyncpg://churnai:churnai@postgres:5432/churnai
REDIS_URL: redis://redis:6379/0
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_started
volumes:
- ./backend:/app
command: arq jobs.worker.WorkerSettings
# ── Frontend (nginx) ──────────────────────────────────────────────────────
frontend:
image: nginx:alpine
restart: unless-stopped
ports:
- "3000:80"
volumes:
- ./frontend:/usr/share/nginx/html:ro
- ./docker/nginx.conf:/etc/nginx/conf.d/default.conf:ro
volumes:
postgres_data: