forked from labring/fastgpt-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (27 loc) · 658 Bytes
/
Dockerfile
File metadata and controls
35 lines (27 loc) · 658 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# --------- builder -----------
FROM oven/bun:1.2-alpine AS builder
WORKDIR /app
# 复制源代码
COPY . .
# 安装依赖
RUN --mount=type=cache,target=/root/.bun \
for i in $(seq 1 3); do \
bun i && break || \
sleep 5; \
done
# 构建
RUN bun run build
# --------- runner -----------
FROM node:22-alpine AS runner
WORKDIR /app
RUN apk add --no-cache\
curl ca-certificates\
&& update-ca-certificates
# copy running files
COPY --from=builder /app/dist/ ./dist/
COPY --from=builder /app/dist/public/ ./public/
ENV NODE_ENV=production
ENV PORT=3000
EXPOSE 3000
ENV serverPath=./dist/index.js
CMD ["node", "dist/index.js", "-p"]