suna/backend/docker-compose.yml

87 lines
1.7 KiB
YAML
Raw Normal View History

2025-04-25 05:15:40 +08:00
version: '3.8'
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
networks:
- app-network
environment:
- REDIS_HOST=redis
- REDIS_PORT=6379
- REDIS_PASSWORD=
2025-04-28 05:21:59 +08:00
- LOG_LEVEL=INFO
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
deploy:
resources:
limits:
cpus: '14'
memory: 48G
reservations:
cpus: '8'
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
redis:
image: redis:7-alpine
ports:
- "127.0.0.1:6379:6379"
volumes:
- redis_data:/data
restart: unless-stopped
networks:
- app-network
2025-04-28 05:21:59 +08:00
command: redis-server --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:
cpus: '2'
memory: 12G
reservations:
cpus: '1'
memory: 8G
2025-04-25 05:15:40 +08:00
rabbitmq:
image: rabbitmq
ports:
- "127.0.0.1:5672:5672"
2025-04-25 05:15:40 +08:00
networks:
app-network:
driver: bridge
volumes:
redis_data: