2025-04-25 05:15:40 +08:00
|
|
|
services:
|
|
|
|
api:
|
|
|
|
build:
|
|
|
|
context: .
|
2025-04-25 06:04:59 +08:00
|
|
|
dockerfile: Dockerfile
|
2025-04-25 05:15:40 +08:00
|
|
|
ports:
|
|
|
|
- "8000:8000"
|
|
|
|
env_file:
|
|
|
|
- .env
|
|
|
|
volumes:
|
|
|
|
- .:/app
|
2025-04-28 05:21:59 +08:00
|
|
|
- ./logs:/app/logs
|
2025-04-25 05:15:40 +08:00
|
|
|
restart: unless-stopped
|
|
|
|
depends_on:
|
|
|
|
redis:
|
|
|
|
condition: service_healthy
|
2025-05-15 14:29:27 +08:00
|
|
|
rabbitmq:
|
|
|
|
condition: service_healthy
|
2025-04-25 05:15:40 +08:00
|
|
|
networks:
|
|
|
|
- app-network
|
|
|
|
environment:
|
|
|
|
- REDIS_HOST=redis
|
|
|
|
- REDIS_PORT=6379
|
|
|
|
- REDIS_PASSWORD=
|
2025-04-28 05:21:59 +08:00
|
|
|
- LOG_LEVEL=INFO
|
2025-05-15 14:29:27 +08:00
|
|
|
- RABBITMQ_HOST=rabbitmq
|
|
|
|
- RABBITMQ_PORT=5672
|
2025-04-28 05:21:59 +08:00
|
|
|
logging:
|
|
|
|
driver: "json-file"
|
|
|
|
options:
|
|
|
|
max-size: "10m"
|
|
|
|
max-file: "3"
|
|
|
|
deploy:
|
|
|
|
resources:
|
|
|
|
limits:
|
2025-05-15 14:29:27 +08:00
|
|
|
cpus: "14"
|
2025-04-28 05:21:59 +08:00
|
|
|
memory: 48G
|
|
|
|
reservations:
|
2025-05-15 14:29:27 +08:00
|
|
|
cpus: "8"
|
2025-04-28 05:21:59 +08:00
|
|
|
memory: 32G
|
|
|
|
healthcheck:
|
|
|
|
test: ["CMD", "curl", "-f", "http://localhost:8000/api/health"]
|
|
|
|
interval: 30s
|
|
|
|
timeout: 10s
|
|
|
|
retries: 3
|
|
|
|
start_period: 40s
|
2025-04-25 05:15:40 +08:00
|
|
|
|
2025-05-15 14:29:27 +08:00
|
|
|
worker-1:
|
|
|
|
build:
|
|
|
|
context: .
|
|
|
|
dockerfile: Dockerfile
|
2025-05-20 22:19:59 +08:00
|
|
|
command: python -m dramatiq --processes 16 --threads 16 run_agent_background
|
2025-05-15 14:29:27 +08:00
|
|
|
env_file:
|
|
|
|
- .env
|
|
|
|
volumes:
|
|
|
|
- .:/app
|
|
|
|
- ./worker-1-logs:/app/logs
|
|
|
|
restart: unless-stopped
|
|
|
|
depends_on:
|
|
|
|
redis:
|
|
|
|
condition: service_healthy
|
|
|
|
rabbitmq:
|
|
|
|
condition: service_healthy
|
|
|
|
networks:
|
|
|
|
- app-network
|
|
|
|
environment:
|
|
|
|
- REDIS_HOST=redis
|
|
|
|
- REDIS_PORT=6379
|
|
|
|
- REDIS_PASSWORD=
|
|
|
|
- LOG_LEVEL=INFO
|
|
|
|
- RABBITMQ_HOST=rabbitmq
|
|
|
|
- RABBITMQ_PORT=5672
|
|
|
|
logging:
|
|
|
|
driver: "json-file"
|
|
|
|
options:
|
|
|
|
max-size: "10m"
|
|
|
|
max-file: "3"
|
|
|
|
deploy:
|
|
|
|
resources:
|
|
|
|
limits:
|
|
|
|
cpus: "14"
|
|
|
|
memory: 48G
|
|
|
|
reservations:
|
|
|
|
cpus: "8"
|
|
|
|
memory: 32G
|
|
|
|
|
|
|
|
worker-2:
|
|
|
|
build:
|
|
|
|
context: .
|
|
|
|
dockerfile: Dockerfile
|
|
|
|
command: python -m dramatiq run_agent_background
|
|
|
|
env_file:
|
|
|
|
- .env
|
|
|
|
volumes:
|
|
|
|
- .:/app
|
|
|
|
- ./worker-2-logs:/app/logs
|
|
|
|
restart: unless-stopped
|
|
|
|
depends_on:
|
|
|
|
redis:
|
|
|
|
condition: service_healthy
|
|
|
|
rabbitmq:
|
|
|
|
condition: service_healthy
|
|
|
|
networks:
|
|
|
|
- app-network
|
|
|
|
environment:
|
|
|
|
- REDIS_HOST=redis
|
|
|
|
- REDIS_PORT=6379
|
|
|
|
- REDIS_PASSWORD=
|
|
|
|
- LOG_LEVEL=INFO
|
|
|
|
- RABBITMQ_HOST=rabbitmq
|
|
|
|
- RABBITMQ_PORT=5672
|
|
|
|
logging:
|
|
|
|
driver: "json-file"
|
|
|
|
options:
|
|
|
|
max-size: "10m"
|
|
|
|
max-file: "3"
|
|
|
|
deploy:
|
|
|
|
resources:
|
|
|
|
limits:
|
|
|
|
cpus: "14"
|
|
|
|
memory: 48G
|
|
|
|
reservations:
|
|
|
|
cpus: "8"
|
|
|
|
memory: 32G
|
|
|
|
|
2025-04-25 05:15:40 +08:00
|
|
|
redis:
|
|
|
|
image: redis:7-alpine
|
|
|
|
ports:
|
|
|
|
- "127.0.0.1:6379:6379"
|
|
|
|
volumes:
|
|
|
|
- redis_data:/data
|
2025-05-19 07:46:08 +08:00
|
|
|
- ./services/docker/redis.conf:/usr/local/etc/redis/redis.conf:ro
|
2025-04-25 05:15:40 +08:00
|
|
|
restart: unless-stopped
|
|
|
|
networks:
|
|
|
|
- app-network
|
2025-05-19 07:46:08 +08:00
|
|
|
command: redis-server /usr/local/etc/redis/redis.conf --appendonly yes --bind 0.0.0.0 --protected-mode no --maxmemory 8gb --maxmemory-policy allkeys-lru
|
2025-04-25 05:15:40 +08:00
|
|
|
healthcheck:
|
|
|
|
test: ["CMD", "redis-cli", "ping"]
|
2025-04-28 05:21:59 +08:00
|
|
|
interval: 10s
|
|
|
|
timeout: 5s
|
|
|
|
retries: 5
|
|
|
|
start_period: 10s
|
|
|
|
logging:
|
|
|
|
driver: "json-file"
|
|
|
|
options:
|
|
|
|
max-size: "10m"
|
|
|
|
max-file: "3"
|
|
|
|
deploy:
|
|
|
|
resources:
|
|
|
|
limits:
|
2025-05-15 14:29:27 +08:00
|
|
|
cpus: "2"
|
2025-04-28 05:21:59 +08:00
|
|
|
memory: 12G
|
|
|
|
reservations:
|
2025-05-15 14:29:27 +08:00
|
|
|
cpus: "1"
|
2025-04-28 05:21:59 +08:00
|
|
|
memory: 8G
|
2025-04-25 05:15:40 +08:00
|
|
|
|
2025-05-14 20:48:02 +08:00
|
|
|
rabbitmq:
|
|
|
|
image: rabbitmq
|
|
|
|
ports:
|
|
|
|
- "127.0.0.1:5672:5672"
|
2025-05-15 14:29:27 +08:00
|
|
|
volumes:
|
|
|
|
- rabbitmq_data:/var/lib/rabbitmq
|
|
|
|
restart: unless-stopped
|
|
|
|
networks:
|
|
|
|
- app-network
|
|
|
|
healthcheck:
|
|
|
|
test: ["CMD", "rabbitmq-diagnostics", "-q", "ping"]
|
|
|
|
interval: 10s
|
|
|
|
timeout: 5s
|
|
|
|
retries: 5
|
|
|
|
start_period: 10s
|
|
|
|
logging:
|
|
|
|
driver: "json-file"
|
|
|
|
options:
|
|
|
|
max-size: "10m"
|
|
|
|
max-file: "3"
|
|
|
|
deploy:
|
|
|
|
resources:
|
|
|
|
limits:
|
|
|
|
cpus: "2"
|
|
|
|
memory: 12G
|
|
|
|
reservations:
|
|
|
|
cpus: "1"
|
|
|
|
memory: 8G
|
2025-05-14 20:48:02 +08:00
|
|
|
|
2025-04-25 05:15:40 +08:00
|
|
|
networks:
|
|
|
|
app-network:
|
|
|
|
driver: bridge
|
|
|
|
|
|
|
|
volumes:
|
2025-05-14 20:48:02 +08:00
|
|
|
redis_data:
|
2025-05-15 14:29:27 +08:00
|
|
|
rabbitmq_data:
|