22 lines
664 B
Docker
22 lines
664 B
Docker
ARG BASE_REGISTRY=harbor-in-k3s.cheverjohn.me/library
|
|
FROM ${BASE_REGISTRY}/node:20-alpine AS builder
|
|
|
|
RUN sed -i "s|dl-cdn.alpinelinux.org|mirrors.aliyun.com|g" /etc/apk/repositories
|
|
RUN corepack enable && corepack prepare pnpm@9 --activate
|
|
|
|
WORKDIR /app
|
|
COPY package.json pnpm-lock.yaml ./
|
|
RUN pnpm install --frozen-lockfile --registry=https://registry.npmmirror.com
|
|
|
|
COPY . .
|
|
RUN pnpm build
|
|
|
|
FROM ${BASE_REGISTRY}/nginx:1.27-alpine
|
|
RUN sed -i "s|dl-cdn.alpinelinux.org|mirrors.aliyun.com|g" /etc/apk/repositories
|
|
|
|
COPY --from=builder /app/dist /usr/share/nginx/html
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
EXPOSE 3000
|
|
CMD ["nginx", "-g", "daemon off;"]
|