amazing2 / Dockerfile
1v1's picture
Create Dockerfile
c3b18a4 verified
raw
history blame contribute delete
436 Bytes
# 使用 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"]