version: '3.8' services: postgres: image: postgres:16-alpine environment: POSTGRES_DB: agentflow POSTGRES_USER: agentflow POSTGRES_PASSWORD: agentflow volumes: - postgres_data:/var/lib/postgresql/data ports: - "5432:5432" healthcheck: test: ["CMD-SHELL", "pg_isready -U agentflow -d agentflow"] interval: 10s timeout: 5s retries: 5 redis: image: redis:7-alpine ports: - "6379:6379" volumes: - redis_data:/data healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 10s timeout: 5s retries: 5 backend: build: context: ./backend dockerfile: Dockerfile environment: - DATABASE_URL=postgresql+asyncpg://agentflow:agentflow@postgres:5432/agentflow - REDIS_URL=redis://redis:6379/0 - SECRET_KEY=your-secret-key-change-in-production-min-32-chars - ENVIRONMENT=development - DEBUG=true - OPENAI_API_KEY=${OPENAI_API_KEY} - ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY} ports: - "8000:8000" depends_on: postgres: condition: service_healthy redis: condition: service_healthy volumes: - ./backend:/app command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload frontend: build: context: ./frontend dockerfile: Dockerfile environment: - VITE_API_URL=http://localhost:8000/api/v1 ports: - "3000:3000" depends_on: - backend volumes: - ./frontend:/app - /app/node_modules command: npm run dev -- --host 0.0.0.0 volumes: postgres_data: redis_data: