-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
71 lines (67 loc) · 2.18 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
71 lines (67 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
# =============================================================================
# Draft - Production Docker Compose
# =============================================================================
# Usage:
# docker compose up # SQLite backend (default, no Redis needed)
# docker compose --profile redis up # Redis backend (for multi-worker)
# =============================================================================
services:
# ----------- API + Worker (SQLite backend) -----------
api:
build: .
ports:
- "${PORT:-8000}:8000"
volumes:
- draft-data:/app/data
- draft-logs:/app/logs
# Mount the host repo for worktree operations (optional)
- ${GIT_REPO_PATH:-.}:/repo:rw
environment:
- TASK_BACKEND=${TASK_BACKEND:-sqlite}
- DATABASE_URL=sqlite+aiosqlite:///./data/draft.db
- GIT_REPO_PATH=/repo
- CORS_ORIGINS=${CORS_ORIGINS:-http://localhost:8000}
- SENTRY_DSN=${SENTRY_DSN:-}
- OPENAI_API_KEY=${OPENAI_API_KEY:-}
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY:-}
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID:-}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY:-}
- AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION:-}
- REDIS_URL=${REDIS_URL:-redis://redis:6379/0}
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
restart: unless-stopped
# ----------- Nginx (serves built frontend + reverse proxy) -----------
nginx:
image: nginx:alpine
ports:
- "${FRONTEND_PORT:-80}:80"
volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
depends_on:
api:
condition: service_healthy
restart: unless-stopped
# ----------- Redis (optional, only with --profile redis) -----------
redis:
image: redis:7-alpine
profiles:
- redis
ports:
- "6379:6379"
volumes:
- redis-data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 3
restart: unless-stopped
volumes:
draft-data:
draft-logs:
redis-data: