Update Dockerfile
Browse files- Dockerfile +16 -4
Dockerfile
CHANGED
@@ -1,12 +1,24 @@
|
|
1 |
# FROM lobehub/lobe-chat:v0.99.1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
FROM lobehub/lobe-chat:latest
|
3 |
|
4 |
-
#
|
5 |
-
COPY --from=
|
|
|
|
|
6 |
|
7 |
# 设置端口
|
8 |
EXPOSE 3210
|
9 |
ENV PORT=3210
|
10 |
|
11 |
-
#
|
12 |
-
|
|
|
|
|
|
1 |
# FROM lobehub/lobe-chat:v0.99.1
|
2 |
+
# 使用 busybox 作为中间镜像来准备文件
|
3 |
+
FROM busybox:latest AS prepare
|
4 |
+
COPY --from=cloudflare/cloudflared:latest /usr/local/bin/cloudflared /bin/cloudflared
|
5 |
+
RUN mkdir -p /app && \
|
6 |
+
echo '#!/bin/sh\ncloudflared tunnel --no-autoupdate run --token $CF_TOKEN & \nexec /bin/node /app/startServer.js' > /app/start.sh && \
|
7 |
+
chmod +x /app/start.sh
|
8 |
+
|
9 |
+
# 最终镜像
|
10 |
FROM lobehub/lobe-chat:latest
|
11 |
|
12 |
+
# 复制需要的文件
|
13 |
+
COPY --from=prepare /bin/cloudflared /bin/cloudflared
|
14 |
+
COPY --from=prepare /app/start.sh /app/start.sh
|
15 |
+
COPY --from=busybox:latest /bin/sh /bin/sh
|
16 |
|
17 |
# 设置端口
|
18 |
EXPOSE 3210
|
19 |
ENV PORT=3210
|
20 |
|
21 |
+
# 使用新的启动脚本
|
22 |
+
ENTRYPOINT ["/bin/sh"]
|
23 |
+
CMD ["/app/start.sh"]
|
24 |
+
|