# 自托管编排(标准服务器档,ADR-024 统一 PostgreSQL) # 用法:docker compose -f docker/docker-compose.app.yml up -d --build services: hunjing-postgres: image: pgvector/pgvector:pg17 container_name: hunjing-postgres restart: unless-stopped environment: POSTGRES_USER: hunjing POSTGRES_PASSWORD: ${HUNJING_DB_PASSWORD:?请在 .env 设置 HUNJING_DB_PASSWORD} POSTGRES_DB: hunjing volumes: - hunjing-pgdata:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U hunjing -d hunjing"] interval: 5s timeout: 3s retries: 12 hunjing-api: build: context: ../backend dockerfile: ../docker/Dockerfile.backend container_name: hunjing-api restart: unless-stopped depends_on: hunjing-postgres: condition: service_healthy environment: DATABASE_URL: postgresql+asyncpg://hunjing:${HUNJING_DB_PASSWORD}@hunjing-postgres:5432/hunjing HUNJING_ENV: production HUNJING_LOG_LEVEL: info ports: - "127.0.0.1:8000:8000" volumes: hunjing-pgdata: