feat: front base dockerfile

This commit is contained in:
tao.chen
2026-08-04 18:48:15 +08:00
parent 00f50d4603
commit bbf166f3c8
2 changed files with 26 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
# =============================================================================
# nginx-base
# nginx 运行时阶段的公共基础镜像:只包含时区配置(apk 换源如有需要可在此追加)
# 构建: docker build -f nginx-base.Dockerfile -t your-registry/nginx-base:alpine .
# 推送: docker push your-registry/nginx-base:alpine
# =============================================================================
FROM nginx:alpine
ENV TZ=Asia/Shanghai
RUN apk add --no-cache tzdata \
&& ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \
&& echo $TZ > /etc/timezone
+13
View File
@@ -0,0 +1,13 @@
# =============================================================================
# node-pnpm-base
# 前端构建阶段的公共基础镜像:只包含 node 运行时 + 激活好的 pnpm
# 不包含 pnpm installinstall 依赖 package.json/lock,每个项目/每次依赖变更都不同,
# 所以不放进 base,留在业务 Dockerfile 里)
# 构建: docker build -f node-pnpm-base.Dockerfile -t your-registry/node-pnpm-base:24.18.1 .
# 推送: docker push your-registry/node-pnpm-base:24.18.1
# =============================================================================
FROM node:24.18.1-slim
WORKDIR /app
RUN corepack enable && corepack prepare pnpm@10.15.1 --activate