19yuke2-frontend/Dockerfile

20 lines
447 B
Docker
Raw Normal View History

2023-08-03 14:13:11 +08:00
FROM node:18-alpine as build-stage
2023-02-05 18:11:34 +08:00
WORKDIR /app
RUN corepack enable
COPY .npmrc package.json pnpm-lock.yaml ./
RUN --mount=type=cache,id=pnpm-store,target=/root/.pnpm-store \
pnpm install --frozen-lockfile
COPY . .
RUN pnpm build
FROM nginx:stable-alpine as production-stage
2023-08-05 11:24:31 +08:00
COPY --from=build-stage /app/nginx/conf.d /etc/nginx/conf.d
2023-08-12 17:25:16 +08:00
COPY --from=build-stage /app/dist /usr/share/nginx/html/
2023-02-05 18:11:34 +08:00
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]