sh / Dockerfile
l-g-t's picture
Update Dockerfile
7f18d72 verified
raw
history blame contribute delete
826 Bytes
# 使用官方 Debian 基础镜像 (或者您可以选择 Ubuntu)
FROM debian:bookworm-slim
# 安装必要的系统工具和 Python 环境
# 添加 python3-pip 来安装 Python 依赖
RUN apt-get update && \
apt-get install -y --no-install-recommends \
bash \
curl \
htop \
nano \
wget \
iputils-ping \
net-tools \
python3 \
python3-pip \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# 设置工作目录
WORKDIR /app
# 复制依赖文件
COPY requirements.txt .
# !!! 新增步骤: 安装 Python 依赖 (Flask) !!!
RUN pip3 install --break-system-packages -r requirements.txt
# 复制保持容器运行所需的 Python 脚本和启动脚本
COPY app.py .
COPY start.sh .
# 暴露唯一的 Web 端口
EXPOSE 7860
# 容器启动命令
CMD ["bash", "start.sh"]