优化 Gunicorn 并发配置并更新 Docker Compose 命令

This commit is contained in:
ucmao
2026-09-08 10:21:56 +08:00
parent a77a914f0d
commit bebb133210
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -28,4 +28,4 @@ RUN chmod +x /app/docker-entrypoint.sh
EXPOSE 8051
ENTRYPOINT ["/app/docker-entrypoint.sh"]
CMD ["gunicorn", "--workers", "3", "--bind", "0.0.0.0:8051", "app:app"]
CMD ["gunicorn", "--workers", "2", "--threads", "4", "--worker-class", "gthread", "--timeout", "120", "--keep-alive", "5", "--bind", "0.0.0.0:8051", "app:app"]
+3 -2
View File
@@ -125,10 +125,11 @@ git clone https://github.com/ucmao/media-parser.git
cd media-parser
# 2. 构建并启动服务
docker-compose up -d --build
docker compose up -d --build
# 3. 查看日志与运行状态
docker-compose logs -f web
docker compose logs -f web
# (注:如为旧版本 Docker V1 环境,请使用 docker-compose up -d --build)
```
服务默认监听 `8051` 端口,启动后直接访问 [http://localhost:8051](http://localhost:8051)。