chore: update code 周一-2025-11 17:57
This commit is contained in:
@@ -28,7 +28,9 @@ COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir --upgrade pip && \
|
||||
pip install --no-cache-dir -r requirements.txt && \
|
||||
pip install --no-cache-dir gunicorn && \
|
||||
which gunicorn || echo "Gunicorn installed via python -m"
|
||||
python -m pip install --force-reinstall gunicorn && \
|
||||
python -c "import gunicorn; print(f'Gunicorn version: {gunicorn.__version__}')" && \
|
||||
python -m gunicorn --version || echo "Gunicorn installed, using python -m gunicorn"
|
||||
|
||||
# 复制应用代码
|
||||
COPY . .
|
||||
@@ -49,5 +51,5 @@ HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
||||
# 使用gunicorn启动应用(生产环境)
|
||||
# 注意:默认配置使用2个worker,适合1GB+内存的机器
|
||||
# 如果机器内存较小(512MB-1GB),建议修改为 "--workers", "1"
|
||||
# 使用 python -m gunicorn 确保可以找到 gunicorn
|
||||
# 使用 python -m gunicorn 确保可以找到 gunicorn(即使可执行文件不在PATH中也能工作)
|
||||
CMD ["python", "-m", "gunicorn", "--bind", "0.0.0.0:5000", "--workers", "2", "--timeout", "120", "--access-logfile", "-", "--error-logfile", "-", "web_app:app"]
|
||||
|
||||
Reference in New Issue
Block a user