services: db: image: postgres:16-alpine restart: unless-stopped environment: POSTGRES_USER: ${POSTGRES_USER:-postgres} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres} POSTGRES_DB: ${POSTGRES_DB:-student_archive} volumes: - pgdata:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"] interval: 5s timeout: 5s retries: 5 networks: - appnet api: build: ./backend restart: unless-stopped environment: DATABASE_URL: postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres}@db:5432/${POSTGRES_DB:-student_archive} SECRET_KEY: ${SECRET_KEY:-dev-secret-key-change-in-production} CORS_ORIGINS: ${CORS_ORIGINS:-http://localhost:23566} UPLOAD_DIR: /app/uploads OLLAMA_BASE_URL: ${OLLAMA_BASE_URL:-http://host.docker.internal:11434} OLLAMA_MODEL: ${OLLAMA_MODEL:-qwen2.5:7b} FLUCTUATION_THRESHOLD: ${FLUCTUATION_THRESHOLD:-0.08} volumes: - ./uploads:/app/uploads depends_on: db: condition: service_healthy extra_hosts: - "host.docker.internal:host-gateway" networks: - appnet web: build: ./frontend restart: unless-stopped ports: - "${WEB_PORT:-23566}:80" depends_on: - api networks: - appnet volumes: pgdata: networks: appnet: driver: bridge