diff --git a/Dockerfile b/Dockerfile index d2ba1a2..86d5db3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -61,8 +61,8 @@ RUN rm -rf /app/components && ln -sf /app/templates/components /app/components ENV PYTHONUNBUFFERED=1 ENV FLASK_APP=app.py -# 暴露端口 -EXPOSE 5000 +# 暴露端口(容器內 app 綁 80,docker-compose / k8s 對外映射依環境而定) +EXPOSE 80 -# 啟動應用 -CMD ["python", "app.py"] +# 啟動應用(production 用 gunicorn,4 workers + 300s timeout + 啟用 access/error log) +CMD ["gunicorn", "--bind", "0.0.0.0:80", "--workers", "4", "--timeout", "300", "--access-logfile", "-", "--error-logfile", "-", "app:app"]