Files
QQuiz/docker-compose-single.yml

37 lines
843 B
YAML
Raw Permalink 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-compose -f docker-compose-single.yml up -d
version: '3.8'
services:
qquiz:
build:
context: .
dockerfile: Dockerfile
container_name: qquiz
ports:
- "8000:8000"
env_file:
- .env
environment:
# 数据库配置SQLite 默认,使用持久化卷)
- DATABASE_URL=sqlite+aiosqlite:////app/data/qquiz.db
volumes:
# 持久化数据卷
- qquiz_data:/app/data # 数据库文件
- qquiz_uploads:/app/uploads # 上传文件
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
volumes:
qquiz_data:
qquiz_uploads: