Spaces:
Runtime error
Runtime error
Create Dockerfile
Browse files- Dockerfile +25 -0
Dockerfile
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 使用官方 Python 3 镜像作为基础镜像
|
| 2 |
+
FROM python:3.12
|
| 3 |
+
|
| 4 |
+
# 设置环境变量以确保 Python 输出被正确刷新
|
| 5 |
+
ENV PYTHONUNBUFFERED=1
|
| 6 |
+
|
| 7 |
+
# 安装 git 和其他必要的依赖
|
| 8 |
+
RUN apt-get update && \
|
| 9 |
+
apt-get install -y git && \
|
| 10 |
+
rm -rf /var/lib/apt/lists/*
|
| 11 |
+
|
| 12 |
+
# 设置工作目录
|
| 13 |
+
WORKDIR /app
|
| 14 |
+
|
| 15 |
+
# 克隆指定的 GitHub 仓库
|
| 16 |
+
RUN git clone https://github.com/zhanghxiao/web-ui.git .
|
| 17 |
+
|
| 18 |
+
# 安装 Python 依赖
|
| 19 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 20 |
+
|
| 21 |
+
# 暴露应用所使用的端口
|
| 22 |
+
EXPOSE 7788
|
| 23 |
+
|
| 24 |
+
# 设置容器启动时运行的命令
|
| 25 |
+
CMD ["python", "webui.py", "--ip", "0.0.0.0", "--port", "7788"]
|