fix: 修复环境报错问题

This commit is contained in:
Daniel
2026-04-12 20:10:08 +08:00
parent 2051d200ec
commit bdf88f9a8f
4 changed files with 20 additions and 18 deletions

View File

@@ -22,12 +22,15 @@ services:
context: ./backend
container_name: exam-helper-backend
restart: unless-stopped
# AI 相关变量优先从 .env.example 注入;若存在 .env 则覆盖同名项(见 Compose env_file 顺序)
env_file:
- .env.example
- path: .env
required: false
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}
# 本地开发 Vite + Docker 前端均需允许
CORS_ORIGINS: http://localhost:5173,http://localhost:8173
UPLOAD_DIR: /app/uploads
volumes:
- uploads_data:/app/uploads
@@ -35,7 +38,7 @@ services:
db:
condition: service_healthy
ports:
- "8866:8000"
- "127.0.0.1:8866:8000"
frontend:
build:
@@ -45,7 +48,7 @@ services:
depends_on:
- backend
ports:
- "8173:80"
- "127.0.0.1:8173:80"
volumes:
postgres_data: