优化注册功能
This commit is contained in:
41
docker-compose.low-mem.yml
Normal file
41
docker-compose.low-mem.yml
Normal file
@@ -0,0 +1,41 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
web:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.low-mem
|
||||
container_name: diet_recommendation_app_low_mem
|
||||
ports:
|
||||
- "5000:5000"
|
||||
environment:
|
||||
- FLASK_ENV=production
|
||||
- PYTHONUNBUFFERED=1
|
||||
- PYTHONHASHSEED=0
|
||||
- MALLOC_ARENA_MAX=2
|
||||
volumes:
|
||||
# 持久化数据目录
|
||||
- ./data:/app/data
|
||||
- ./logs:/app/logs
|
||||
- ./models:/app/models
|
||||
restart: unless-stopped
|
||||
# 内存限制(小内存机器配置)
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
memory: 512M
|
||||
reservations:
|
||||
memory: 256M
|
||||
networks:
|
||||
- app-network
|
||||
healthcheck:
|
||||
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:5000/health').read()"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 15s
|
||||
|
||||
networks:
|
||||
app-network:
|
||||
driver: bridge
|
||||
|
||||
Reference in New Issue
Block a user