This commit is contained in:
Yvan
2026-09-04 10:51:45 +08:00
parent d94e2ed225
commit af1e194396
17 changed files with 1015 additions and 61 deletions
+5 -24
View File
@@ -1,24 +1,5 @@
# 如果需要用 cicd ,请设置环境变量:
# variables:
# DOCKER_BUILDKIT: 1
FROM node:20-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
COPY . /app
WORKDIR /app
FROM base AS prod-deps
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod
FROM base AS build
COPY --from=prod-deps /app/node_modules /app/node_modules
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install && pnpm run build
FROM nginx:alpine
COPY --from=base /app/.docker-compose/nginx/conf.d/my.conf /etc/nginx/conf.d/my.conf
COPY --from=build /app/dist /usr/share/nginx/html
RUN ls -al /usr/share/nginx/html
FROM docker.m.daocloud.io/nginx:alpine
# nginx.k8s.conf is rendered by Jenkins from
# .docker-compose/nginx/conf.d/my.conf (envsubst '$KRA_APP').
COPY nginx.k8s.conf /etc/nginx/conf.d/default.conf
COPY dist /usr/share/nginx/html