Files
AI-Testing/docker-compose.yml
2026-04-12 19:57:32 +08:00

53 lines
1.4 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Docker Hub 官方镜像:请在本机 Docker 中配置「阿里云镜像加速器」后再构建/拉取
# (控制台:容器镜像服务 ACR → 镜像工具 → 镜像加速器,将地址写入 Docker Engine 的 registry-mirrors
services:
db:
image: postgres:16-alpine
container_name: exam-helper-db
restart: unless-stopped
environment:
POSTGRES_DB: exam_helper
POSTGRES_USER: exam_user
POSTGRES_PASSWORD: exam_pass
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U exam_user -d exam_helper"]
interval: 5s
timeout: 5s
retries: 10
backend:
build:
context: ./backend
container_name: exam-helper-backend
restart: unless-stopped
environment:
DATABASE_URL: postgresql+psycopg://exam_user:exam_pass@db:5432/exam_helper
CORS_ORIGINS: http://localhost:5173
QWEN_API_KEY: ${QWEN_API_KEY:-}
QWEN_BASE_URL: ${QWEN_BASE_URL:-https://dashscope.aliyuncs.com/compatible-mode/v1}
QWEN_MODEL: ${QWEN_MODEL:-qwen-plus}
UPLOAD_DIR: /app/uploads
volumes:
- uploads_data:/app/uploads
depends_on:
db:
condition: service_healthy
ports:
- "8866:8000"
frontend:
build:
context: ./frontend
container_name: exam-helper-frontend
restart: unless-stopped
depends_on:
- backend
ports:
- "8173:80"
volumes:
postgres_data:
uploads_data: