File size: 436 Bytes
c3b18a4 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# 使用 Python 3.10 作为基础镜像
FROM python:3.10-slim
# 设置工作目录
WORKDIR /app
# 复制项目文件
COPY . /app/
# 安装 Python 依赖
RUN pip install --no-cache-dir -r requirements.txt
# 设置环境变量
ENV PYTHONPATH=/app
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' >/etc/timezone
# 暴露端口(如果需要)
EXPOSE 5000
# 启动命令
CMD ["python", "app.py"] |