Skip to content

Commit 79f8457

Browse files
committed
Update Dockerfile
1 parent 3b0a38f commit 79f8457

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Dockerfile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
# 构建阶段
2-
FROM node:20.19.0-alpine3.21 AS build
2+
FROM node:20-bullseye-slim AS build
33
WORKDIR /app
44
COPY . .
55
RUN npm install && \
66
npm run build
77

88
# 运行阶段
9-
FROM svenstaro/miniserve:0.29.0-alpine AS runtime
10-
# 设置端口
11-
ENV MINISERVE_PORT=8080
9+
FROM node:20-bullseye-slim AS runtime
1210
WORKDIR /app
1311
COPY --from=build /app/dist /app
12+
RUN npm install -g http-server
1413

1514
EXPOSE 8080
1615

17-
CMD ["--index", "/app/index.html"]
16+
CMD ["http-server", "/app", "-p", "8080"]

0 commit comments

Comments
 (0)