This repository has been archived on 2025-02-10. You can view files and clone it, but cannot push or open issues or pull requests.
lastin-ai/docker/docker-compose.yml

90 lines
1.9 KiB
YAML

version: '3.8'
services:
app:
build:
context: ..
dockerfile: docker/Dockerfile
target: production
command: python -m src.orchestration.agent_controller
env_file:
- ../.env
ports:
- "8000:8000"
volumes:
- ../cache:/app/cache
- ../data:/app/data
- ../logs:/app/logs
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_started
environment:
- PYTHONPATH=/app
- PYTHONUNBUFFERED=1
networks:
- lastin_network
deploy:
resources:
limits:
cpus: '1'
memory: 2G
reservations:
memory: 1G
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 5s
restart: unless-stopped
postgres:
image: postgres:15-alpine
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
networks:
- lastin_network
deploy:
resources:
limits:
cpus: '1'
memory: 1G
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
redis:
image: redis:7-alpine
volumes:
- redis_data:/data
command: redis-server --save 60 1 --loglevel warning
networks:
- lastin_network
deploy:
resources:
limits:
cpus: '0.5'
memory: 512M
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
networks:
lastin_network:
driver: bridge
volumes:
postgres_data:
redis_data: