-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
73 lines (67 loc) · 2.06 KB
/
docker-compose.yml
File metadata and controls
73 lines (67 loc) · 2.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
# ARGent Docker Compose configuration
# 4-container architecture: app, worker, postgres, redis
name: argent
services:
app:
build: .
ports:
- "8000:8000"
env_file:
- .env.local
environment:
- DATABASE_URL=postgresql+asyncpg://argent:${DB_PASSWORD:-argent}@postgres:5432/argent
- REDIS_URL=redis://redis:6379
- DEBUG=${DEBUG:-true}
- SECRET_KEY=${SECRET_KEY:-change-me-in-production}
- WATCHFILES_FORCE_POLLING=true # Fix hot reload in Docker
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_started
volumes:
- ./src:/app/src:ro # Mount source for development
- ./alembic:/app/alembic # Mount alembic for migrations
- ./pyproject.toml:/app/pyproject.toml:ro # Mount config for dev tools
- ./scripts:/app/scripts:ro # Mount scripts for debugging
command: uvicorn argent.main:app --host 0.0.0.0 --port 8000 --reload
worker:
build: .
env_file:
- .env.local
environment:
- DATABASE_URL=postgresql+asyncpg://argent:${DB_PASSWORD:-argent}@postgres:5432/argent
- REDIS_URL=redis://redis:6379
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_started
volumes:
- ./src:/app/src:ro # Mount source for development
command: huey_consumer.py argent.scheduler.tasks.huey -w 2 -k thread
postgres:
image: postgres:16-alpine
environment:
- POSTGRES_DB=argent
- POSTGRES_USER=argent
- POSTGRES_PASSWORD=${DB_PASSWORD:-argent}
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5433:5432" # Use 5433 to avoid conflict with host PostgreSQL
healthcheck:
test: ["CMD-SHELL", "pg_isready -U argent -d argent"]
interval: 5s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
volumes:
- redis_data:/data
ports:
- "6380:6379" # Use 6380 to avoid conflict with host Redis
command: redis-server --appendonly yes
volumes:
postgres_data:
redis_data: