修改端口为7400
This commit is contained in:
@@ -56,13 +56,13 @@ RUN mkdir -p templates static/css static/js logs data models
|
||||
RUN chmod +x start_web.py
|
||||
|
||||
# 暴露端口
|
||||
EXPOSE 5000
|
||||
EXPOSE 7400
|
||||
|
||||
# 健康检查(不使用 requests,直接用 Python)
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
|
||||
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:5000/health').read()" || exit 1
|
||||
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:7400/health').read()" || exit 1
|
||||
|
||||
# 使用gunicorn启动应用(小内存配置:单worker,减少内存占用)
|
||||
# 使用 python -m gunicorn 确保可以找到 gunicorn(即使可执行文件不在PATH中也能工作)
|
||||
CMD ["python", "-m", "gunicorn", "--bind", "0.0.0.0:5000", "--workers", "1", "--threads", "2", "--timeout", "120", "--worker-class", "sync", "--max-requests", "1000", "--max-requests-jitter", "100", "--preload", "--access-logfile", "-", "--error-logfile", "-", "web_app:app"]
|
||||
CMD ["python", "-m", "gunicorn", "--bind", "0.0.0.0:7400", "--workers", "1", "--threads", "2", "--timeout", "120", "--worker-class", "sync", "--max-requests", "1000", "--max-requests-jitter", "100", "--preload", "--access-logfile", "-", "--error-logfile", "-", "web_app:app"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user