Update Dockerfile
Browse files- Dockerfile +8 -17
Dockerfile
CHANGED
@@ -1,24 +1,15 @@
|
|
1 |
# FROM lobehub/lobe-chat:v0.99.1
|
2 |
-
# 使用
|
3 |
-
FROM
|
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 |
-
|
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 |
-
|
23 |
-
CMD ["/app/start.sh"]
|
24 |
-
|
|
|
1 |
# FROM lobehub/lobe-chat:v0.99.1
|
2 |
+
# 使用 multi-stage build
|
3 |
+
FROM cloudflare/cloudflared:latest as cloudflared
|
|
|
|
|
|
|
|
|
4 |
|
5 |
+
FROM node:20-slim as runner
|
6 |
+
WORKDIR /app
|
7 |
+
COPY --from=lobehub/lobe-chat:latest / ./
|
8 |
+
COPY --from=cloudflared /usr/local/bin/cloudflared /usr/local/bin/cloudflared
|
|
|
|
|
|
|
9 |
|
10 |
# 设置端口
|
11 |
EXPOSE 3210
|
12 |
ENV PORT=3210
|
13 |
|
14 |
+
# 使用 node 作为基础镜像的启动命令
|
15 |
+
CMD cloudflared tunnel --no-autoupdate run --token $CF_TOKEN & node startServer.js
|
|
|
|