version: '3.8' services: postgres: image: postgres:15-alpine environment: POSTGRES_DB: s2f_db POSTGRES_USER: s2f_user POSTGRES_PASSWORD: s2f_password ports: - "5432:5432" volumes: - postgres_data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U s2f_user -d s2f_db"] interval: 10s timeout: 5s retries: 5 backend: build: ./backend environment: DATABASE_URL: postgresql+asyncpg://s2f_user:s2f_password@postgres:5432/s2f_db ALLOWED_ORIGINS: '["http://localhost:3000"]' DEBUG: "true" ports: - "8000:8000" volumes: - ./backend:/app - ./backend/uploads:/app/uploads depends_on: postgres: condition: service_healthy command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload frontend: build: ./frontend environment: NEXT_PUBLIC_API_URL: http://localhost:8000 NEXT_PUBLIC_APP_NAME: "财务 AI 助手(薪财通 AI)" ports: - "3000:3000" volumes: - ./frontend:/app - /app/node_modules - /app/.next depends_on: - backend volumes: postgres_data: