mirror of
https://github.com/handsomezhuzhu/QQuiz.git
synced 2026-02-20 20:10:14 +00:00
## 修复 ### Docker Compose - 移除过时的 version 字段警告 - 优化配置以支持最新版本 ### 网络优化 - 添加 Docker 镜像加速器配置指南 - 创建自动化配置脚本 - 提供国内优化版启动脚本 ## 新增文件 - DOCKER_MIRROR_SETUP.md: 详细的镜像加速配置教程 - setup_docker_mirror.bat: 交互式配置指南 - start_windows_china.bat: 国内网络优化版启动脚本 ## 改进 - 解决 Docker Hub 访问慢/失败问题 - 提供多个国内镜像源配置 - 自动检测和提示配置镜像加速 🚀 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
57 lines
1.2 KiB
YAML
57 lines
1.2 KiB
YAML
services:
|
|
postgres:
|
|
image: postgres:15-alpine
|
|
container_name: qquiz_postgres
|
|
environment:
|
|
POSTGRES_USER: qquiz
|
|
POSTGRES_PASSWORD: qquiz_password
|
|
POSTGRES_DB: qquiz_db
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
ports:
|
|
- "5432:5432"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U qquiz"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
backend:
|
|
build:
|
|
context: ./backend
|
|
dockerfile: Dockerfile
|
|
container_name: qquiz_backend
|
|
environment:
|
|
- DATABASE_URL=postgresql+asyncpg://qquiz:qquiz_password@postgres:5432/qquiz_db
|
|
env_file:
|
|
- .env
|
|
volumes:
|
|
- ./backend:/app
|
|
- upload_files:/app/uploads
|
|
ports:
|
|
- "8000:8000"
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
command: uvicorn main:app --host 0.0.0.0 --port 8000 --reload
|
|
|
|
frontend:
|
|
build:
|
|
context: ./frontend
|
|
dockerfile: Dockerfile
|
|
container_name: qquiz_frontend
|
|
volumes:
|
|
- ./frontend:/app
|
|
- /app/node_modules
|
|
ports:
|
|
- "3000:3000"
|
|
environment:
|
|
- REACT_APP_API_URL=http://localhost:8000
|
|
depends_on:
|
|
- backend
|
|
command: npm start
|
|
|
|
volumes:
|
|
postgres_data:
|
|
upload_files:
|