volumes: aperag-postgres-data: {} aperag-qdrant-data: {} aperag-redis-data: {} aperag-es-data: {} aperag-neo4j-data: {} aperag-shared-data: {} services: # ============================================== # Application Services (Default startup, excluded from infra) # ============================================== api: &api build: context: . dockerfile: ./Dockerfile image: ${REGISTRY:-docker.io}/apecloud/aperag:${VERSION:-v0.0.0-nightly} container_name: aperag-api depends_on: redis: condition: service_healthy postgres: condition: service_healthy qdrant: condition: service_healthy es: condition: service_healthy volumes: - ~/.cache:/root/.cache - aperag-shared-data:/shared env_file: - .env - envs/docker.env.overrides environment: - DOCRAY_HOST=${DOCRAY_HOST} ports: - "8000:8000" command: ["/app/scripts/entrypoint.sh", "/app/scripts/start-api.sh"] healthcheck: test: ["CMD-SHELL", "curl -f http://localhost:8000/health || curl -f http://localhost:8000/docs || exit 1"] interval: 10s timeout: 5s retries: 12 # 12 * 10s = 120s (2 minutes) start_period: 30s # Give API time to start up before first check frontend: build: context: ./web dockerfile: ./Dockerfile image: ${REGISTRY:-docker.io}/apecloud/aperag-frontend:${VERSION:-v0.0.0-nightly} container_name: aperag-frontend depends_on: api: condition: service_healthy env_file: - web/deploy/env.local.template environment: - API_SERVER_ENDPOINT=http://api:8000 - API_SERVER_BASE_PATH=/api/v1 ports: - "3000:3000" celeryworker: image: ${REGISTRY:-docker.io}/apecloud/aperag:${VERSION:-v0.0.0-nightly} build: context: . dockerfile: ./Dockerfile container_name: aperag-celeryworker depends_on: redis: condition: service_healthy postgres: condition: service_healthy qdrant: condition: service_healthy es: condition: service_healthy volumes: - ~/.cache:/root/.cache - ./resources:/data/resources - aperag-shared-data:/shared env_file: - .env - envs/docker.env.overrides environment: - NODE_IP=aperag-celeryworker - DOCRAY_HOST=${DOCRAY_HOST} - APERAG_API_BASE_URL=http://aperag-api:8000 command: ["/app/scripts/entrypoint.sh", "/app/scripts/start-celery-worker.sh"] celerybeat: image: ${REGISTRY:-docker.io}/apecloud/aperag:${VERSION:-v0.0.0-nightly} build: context: . dockerfile: ./Dockerfile container_name: aperag-celerybeat env_file: - .env - envs/docker.env.overrides depends_on: redis: condition: service_healthy postgres: condition: service_healthy environment: - NODE_IP=aperag-celerybeat command: ["/app/scripts/entrypoint.sh", "/app/scripts/start-celery-beat.sh"] flower: <<: *api image: ${REGISTRY:-docker.io}/apecloud/aperag:${VERSION:-v0.0.0-nightly} build: context: . dockerfile: ./Dockerfile container_name: aperag-flower depends_on: redis: condition: service_healthy postgres: condition: service_healthy env_file: - .env - envs/docker.env.overrides ports: - "5555:5555" environment: - NODE_IP=aperag-flower command: ["/app/scripts/entrypoint.sh", "/app/scripts/start-celery-flower.sh"] # ============================================== # Infrastructure Services (always available) # ============================================== postgres: image: pgvector/pgvector:pg16 container_name: aperag-postgres volumes: - aperag-postgres-data:/var/lib/postgresql/data ports: - "5432:5432" environment: - POSTGRES_PASSWORD=postgres - POSTGRES_USER=postgres - POSTGRES_DB=aperag healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres -d aperag"] interval: 10s timeout: 5s retries: 5 start_period: 10s redis: image: redis:6 container_name: aperag-redis volumes: - aperag-redis-data:/data ports: - "6379:6379" healthcheck: test: ["CMD-SHELL", "redis-cli ping | grep PONG"] interval: 10s timeout: 3s retries: 5 start_period: 5s qdrant: image: qdrant/qdrant:v1.13.4 container_name: aperag-qdrant volumes: - aperag-qdrant-data:/qdrant/storage ports: - "6333:6333" healthcheck: test: ["CMD-SHELL", "nc -z localhost 6333 || timeout 3 bash -c '