ci: 推送 main 自动构建镜像并部署到 demo.chener.ymen.site
Deploy / deploy (push) Failing after 1m33s

This commit is contained in:
chener committed 2026-11-07 21:30:43 +08:00
1 parent 99b11d1a17
commit a48ee17553
5 files changed
+143

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
# ---- 构建阶段 ----
FROM node:24-alpine AS builder
WORKDIR /app
# 先只拷贝依赖清单,配合 Docker 层缓存:源码变动时不会重复装依赖
COPY package.json package-lock.json ./
RUN npm ci --no-audit --no-fund
COPY . .
RUN npm run build
# ---- 运行阶段 ----
FROM nginx:1.27-alpine
COPY deploy/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /app/dist /usr/share/nginx/html
EXPOSE 80