Files
QQuiz/docker-compose.yml
handsomezhuzhu 39f7091e1f 🔧 Fix Docker network issues for China users
## 修复

### 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>
2025-12-01 12:51:36 +08:00

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: