Skip to content

Commit 20741fb

Browse files
committed
chore: 使用 http-server 替代 nginx
1 parent b2b7368 commit 20741fb

File tree

2 files changed

+11
-24
lines changed

2 files changed

+11
-24
lines changed

Dockerfile

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,15 @@ COPY . .
1515

1616
RUN npm run build
1717

18-
FROM nginx:1.23.4 AS runner
18+
FROM base AS runner
19+
WORKDIR /app
20+
21+
ENV NODE_ENV production
22+
23+
RUN npm install http-server -g
24+
25+
COPY --from=builder /app/dist ./dist
26+
27+
EXPOSE 8080
1928

20-
COPY nginx.conf nginx.conf
21-
ARG PORT=80
22-
RUN envsubst '${PORT}' < nginx.conf > /etc/nginx/conf.d/default.conf
23-
COPY --from=builder /app/dist /usr/share/nginx/html
29+
CMD ["http-server", "./dist", "-d", "false"]

nginx.conf

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)