Files
outlookapi/Dockerfile
huangzhenpc 4d8ea56a45 xx
2025-03-26 11:39:59 +08:00

21 lines
439 B
Docker

FROM python:3.9-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
# 设置环境变量
ENV PORT=5000
ENV HOST=0.0.0.0
ENV DEBUG=False
# Redis连接URL可以在运行容器时通过环境变量传入
# ENV REDIS_URL=redis://redis:6379/0
# ENV API_KEY=your_api_key
EXPOSE 5000
# 使用Gunicorn作为生产级WSGI服务器
CMD gunicorn --workers=4 --bind ${HOST}:${PORT} mail_api:app