fix: 修复 run.py 导入错误 + 添加生产环境 docker-compose
- 修复 socketio 导入问题
- 添加 docker-compose.prod.yaml(简化版,使用 SQLite + Redis)
作者: 小白 🐶
This commit is contained in:
50
docker-compose.prod.yaml
Normal file
50
docker-compose.prod.yaml
Normal file
@@ -0,0 +1,50 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
pit-router:
|
||||
build: .
|
||||
ports:
|
||||
- "1999:1999"
|
||||
environment:
|
||||
- FLASK_ENV=production
|
||||
- SECRET_KEY=${SECRET_KEY}
|
||||
- JWT_SECRET_KEY=${JWT_SECRET_KEY}
|
||||
- DATABASE_URL=sqlite:////app/data/pit.db
|
||||
- REDIS_URL=redis://redis:6379/0
|
||||
volumes:
|
||||
- pit-data:/app/data
|
||||
- pit-logs:/app/logs
|
||||
depends_on:
|
||||
redis:
|
||||
condition: service_healthy
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:1999/health"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 40s
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '2.0'
|
||||
memory: 2G
|
||||
reservations:
|
||||
cpus: '0.5'
|
||||
memory: 512M
|
||||
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
volumes:
|
||||
- redis-data:/data
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
volumes:
|
||||
pit-data:
|
||||
pit-logs:
|
||||
redis-data:
|
||||
Reference in New Issue
Block a user