services: backend: build: . env_file: .env environment: DATABASE_URL: postgresql+asyncpg://postgres:${POSTGRES_PASSWORD:-postgres}@db:5432/agentgraph REDIS_URL: redis://redis:6379/0 ports: - "8000:8000" depends_on: db: condition: service_healthy redis: condition: service_healthy restart: unless-stopped frontend: build: ./web ports: - "80:80" depends_on: - backend restart: unless-stopped db: image: postgres:16-alpine environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres} POSTGRES_DB: agentgraph volumes: - pgdata:/var/lib/postgresql/data ports: - "5432:5432" healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 10s timeout: 5s retries: 5 restart: unless-stopped redis: image: redis:7-alpine ports: - "6379:6379" volumes: - redisdata:/data healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 10s timeout: 5s retries: 5 restart: unless-stopped migrate: build: . command: alembic upgrade head env_file: .env environment: DATABASE_URL: postgresql+asyncpg://postgres:${POSTGRES_PASSWORD:-postgres}@db:5432/agentgraph depends_on: db: condition: service_healthy restart: "no" volumes: pgdata: redisdata: