Files
outlookEmailPlus/Dockerfile
T
2026-01-20 21:01:02 +08:00

36 lines
800 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 使用 Python 3.11 作为基础镜像
FROM python:3.11-slim
# 设置工作目录
WORKDIR /app
# 安装 curl(用于健康检查)
RUN apt-get update && \
apt-get install -y --no-install-recommends curl && \
rm -rf /var/lib/apt/lists/*
# 设置环境变量
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=1
# 复制依赖文件
COPY requirements.txt .
# 安装依赖(包括生产服务器)
RUN pip install --upgrade pip && \
pip install -r requirements.txt && \
pip install gunicorn
# 复制应用代码
COPY . .
# 创建数据目录
RUN mkdir -p /app/data
# 暴露端口
EXPOSE 5000
# 启动应用(使用 Gunicorn)
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:5000", "--timeout", "120", "--access-logfile", "-", "web_outlook_app:app"]