2022-07-01 00:09:36 +08:00
|
|
|
FROM node:16-alpine as build-stage
|
|
|
|
|
|
|
|
WORKDIR /app
|
2022-06-30 21:47:22 +08:00
|
|
|
RUN corepack enable
|
2022-07-01 00:09:36 +08:00
|
|
|
|
|
|
|
COPY .npmrc package.json pnpm-lock.yaml ./
|
|
|
|
RUN --mount=type=cache,id=pnpm-store,target=/root/.pnpm-store \
|
|
|
|
pnpm install --frozen-lockfile
|
|
|
|
|
2022-06-30 21:47:22 +08:00
|
|
|
COPY . .
|
|
|
|
RUN pnpm build
|
2022-07-01 00:09:36 +08:00
|
|
|
|
|
|
|
FROM nginx:stable-alpine as production-stage
|
|
|
|
|
|
|
|
COPY --from=build-stage /app/dist /usr/share/nginx/html
|
|
|
|
EXPOSE 80
|
|
|
|
|
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|