Files
resume/Dockerfile
T
wonder d08ef09b3a
Deploy Resume / deploy (push) Successful in 45s
修复 CI:构建镜像升级 node:22-alpine,pnpm 固定 11.28.5
pnpm 11 要求 Node >= 22.13,node:20-alpine 无法运行
2026-11-03 12:22:29 +08:00

31 lines
848 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ---- 构建阶段:由 data/ + templates/ 生成静态站点 ----
FROM node:22-alpine AS build
WORKDIR /app
# 跳过 Playwright 浏览器下载(构建无需浏览器)
ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
# 国内镜像安装依赖(CI runner 在阿里云);pnpm 版本与本地生成 lockfile 的一致
RUN npm install -g pnpm@11.28.5 --registry=https://registry.npmmirror.com
COPY package.json pnpm-lock.yaml .npmrc ./
RUN pnpm install --frozen-lockfile
COPY . .
RUN node scripts/build.mjs && node scripts/check.mjs
# ---- 运行阶段:Nginx 托管 dist/ ----
FROM nginx:alpine
# 复制 Nginx 配置
COPY nginx.conf /etc/nginx/conf.d/default.conf
# 复制构建产物(HTML + txt + css + img)
COPY --from=build /app/dist/ /usr/share/nginx/html/
# 暴露端口
EXPOSE 80
# 启动 Nginx
CMD ["nginx", "-g", "daemon off;"]