jenkins CICD
This commit is contained in:
1 parent
c5f868a8ef
commit
d710a88d04
20 files changed
+1174
-25
No files matched your search
+10
-7
@@ -1,12 +1,15 @@
|
||||
FROM node:22-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm ci
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
FROM nginx:alpine
|
||||
|
||||
# 复制自定义 Nginx 配置
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
# 复制构建好的静态资源
|
||||
# 注意:在本地先执行 npm run build,然后将 dist 目录提交或在部署脚本中生成
|
||||
COPY dist /usr/share/nginx/html
|
||||
COPY --from=builder /app/dist /usr/share/nginx/html
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
Reference in new issue
Block a user