mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-09-28 07:36:38 +08:00
21 lines
351 B
Docker
21 lines
351 B
Docker
# 多阶段构建 - 构建阶段
|
|
FROM node:20.19.0 AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
COPY package*.json ./
|
|
RUN npm install --force
|
|
|
|
COPY . .
|
|
RUN npm run build
|
|
|
|
# 生产阶段
|
|
FROM nginx:stable-alpine AS production-stage
|
|
|
|
COPY nginx.conf /etc/nginx/nginx.conf
|
|
|
|
COPY --from=builder /app/dist /usr/share/nginx/html
|
|
|
|
EXPOSE 80
|
|
|
|
CMD ["nginx", "-g", "daemon off;"] |