ds / Dockerfile
yangtb24's picture
Update Dockerfile
6a051b3 verified
raw
history blame
546 Bytes
# 使用官方 Python 运行时作为父镜像
FROM python:3.9-slim-buster
# 设置工作目录为 /app
WORKDIR /app
# 将当前目录下的 requirements.txt 复制到容器的 /app/requirements.txt 中
COPY requirements.txt /app/
# 安装 requirements.txt 中指定的任何所需软件包
RUN pip install --no-cache-dir -r requirements.txt
# 将当前目录下的其余文件复制到容器的 /app 中
COPY . /app/
# 使端口 5000 可供此容器外的世界使用
EXPOSE 5000
# 在容器启动时运行 app.py
CMD ["python", "app.py"]