Create Dockerfile
Browse files- Dockerfile +26 -0
Dockerfile
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# 使用基础镜像
|
2 |
+
FROM python:3.8
|
3 |
+
|
4 |
+
# 设置工作目录
|
5 |
+
WORKDIR /app
|
6 |
+
|
7 |
+
# 克隆代码并初始化子模块
|
8 |
+
RUN git clone https://github.com/Physton/sd-webui-prompt-all-in-one-app.git --recurse-submodules .
|
9 |
+
|
10 |
+
# 安装Python和依赖
|
11 |
+
RUN apt-get update \
|
12 |
+
&& apt-get install -y \
|
13 |
+
python3-pip \
|
14 |
+
&& pip3 install --upgrade pip \
|
15 |
+
&& pip3 install -r requirements.txt
|
16 |
+
|
17 |
+
# 从密钥中获取.env内容并写入.env文件
|
18 |
+
RUN --mount=type=secret,id=ENV,dst=/etc/secrets/ENV \
|
19 |
+
cat /etc/secrets/ENV > .env \
|
20 |
+
&& chmod 777 .env
|
21 |
+
|
22 |
+
# 暴露端口
|
23 |
+
EXPOSE 7860
|
24 |
+
|
25 |
+
# 运行应用
|
26 |
+
CMD ["python", "app.py"]
|