front/Dockerfile.k3s
xiaolipro 5ae57745be
Some checks failed
Build and Deploy Front / deploy (push) Failing after 3m46s
1
2026-11-11 15:59:38 +08:00

18 lines
698 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.

# k3s / Kaniko 备用:多阶段构建。生产 CI 优先宿主 pnpm + Dockerfile.k3s.runtime
# TLS 由 Traefik(websecure) + cert-manager 终结;API 浏览器直连。
FROM docker.m.daocloud.io/library/node:20-alpine AS build
WORKDIR /app
ARG FRONT_BUILD_SCRIPT=build
RUN corepack enable \
&& corepack prepare pnpm@9.15.9 --activate \
&& pnpm config set registry https://registry.npmmirror.com
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile --ignore-scripts
COPY . .
RUN pnpm run ${FRONT_BUILD_SCRIPT}
FROM docker.m.daocloud.io/library/nginx:1.27-alpine
COPY --from=build /app/dist /usr/share/nginx/html/
COPY nginx-k3s.conf /etc/nginx/conf.d/default.conf
EXPOSE 80