-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
102 lines (94 loc) · 3.51 KB
/
Copy pathdocker-compose.yml
File metadata and controls
102 lines (94 loc) · 3.51 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
96
97
98
99
100
101
102
# Case Automation MCP Server — docker-compose for local development and production
#
# Usage:
# docker compose up # start everything
# docker compose up postgres redis # just the infrastructure (for local dev)
# docker compose up sidecar # just the API
#
# Environment:
# Copy .env.example to .env and fill in values.
# The KEK must be a base64-encoded 32-byte key:
# python3 -c "import secrets, base64; print(base64.b64encode(secrets.token_bytes(32)).decode())"
services:
# ─── Infrastructure ───────────────────────────────────────────────
postgres:
image: postgres:16
environment:
POSTGRES_DB: ${CAM_DB_NAME:-cam}
POSTGRES_USER: ${CAM_DB_USER:-cam}
POSTGRES_PASSWORD: ${CAM_DB_PASSWORD:-cam_dev_pw}
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${CAM_DB_USER:-cam}"]
interval: 5s
timeout: 5s
retries: 10
redis:
image: redis:7-alpine
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 10
# ─── Application ──────────────────────────────────────────────────
sidecar:
build: .
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
environment:
CAM_DATABASE_URL: postgresql+asyncpg://${CAM_DB_USER:-cam}:${CAM_DB_PASSWORD:-cam_dev_pw}@postgres:5432/${CAM_DB_NAME:-cam}
CAM_REDIS_URL: redis://redis:6379/0
CAM_SECRET_BACKEND: env
CAM_ENCRYPTION_KEK: ${CAM_ENCRYPTION_KEK:-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=}
CAM_DOMAIN_PACK: ${CAM_DOMAIN_PACK:-immigration}
CAM_PDF_ENGINE: ${CAM_PDF_ENGINE:-auto}
CAM_LOG_LEVEL: ${CAM_LOG_LEVEL:-INFO}
ports:
- "8001:8001"
# Run migrations then start the sidecar
command: >
sh -c "uv run alembic upgrade head &&
uv run uvicorn cam.sidecar.main:app --host 0.0.0.0 --port 8001"
restart: unless-stopped
worker:
build: .
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
environment:
CAM_DATABASE_URL: postgresql+asyncpg://${CAM_DB_USER:-cam}:${CAM_DB_PASSWORD:-cam_dev_pw}@postgres:5432/${CAM_DB_NAME:-cam}
CAM_REDIS_URL: redis://redis:6379/0
CAM_SECRET_BACKEND: env
CAM_ENCRYPTION_KEK: ${CAM_ENCRYPTION_KEK:-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=}
CAM_DOMAIN_PACK: ${CAM_DOMAIN_PACK:-immigration}
CAM_LOG_LEVEL: ${CAM_LOG_LEVEL:-INFO}
command: >
sh -c "uv run alembic upgrade head &&
uv run celery -A cam.sidecar.celery_app worker -Q cam_deadline --loglevel=info"
restart: unless-stopped
beat:
build: .
depends_on:
redis:
condition: service_healthy
environment:
CAM_DATABASE_URL: postgresql+asyncpg://${CAM_DB_USER:-cam}:${CAM_DB_PASSWORD:-cam_dev_pw}@postgres:5432/${CAM_DB_NAME:-cam}
CAM_REDIS_URL: redis://redis:6379/0
CAM_SECRET_BACKEND: env
CAM_ENCRYPTION_KEK: ${CAM_ENCRYPTION_KEK:-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=}
CAM_DOMAIN_PACK: ${CAM_DOMAIN_PACK:-immigration}
command: >
uv run celery -A cam.sidecar.celery_app beat --loglevel=info
restart: unless-stopped
volumes:
pgdata: