2024-01-07 13:09:45 +00:00
|
|
|
FROM node:20-alpine as build
|
2022-05-03 16:21:11 +00:00
|
|
|
WORKDIR /app
|
2023-09-01 13:27:55 +00:00
|
|
|
ENV PNPM_HOME="/pnpm"
|
|
|
|
ENV PATH="$PNPM_HOME:$PATH"
|
|
|
|
RUN corepack enable
|
|
|
|
|
|
|
|
COPY package.json ./
|
|
|
|
COPY pnpm-lock.yaml ./
|
|
|
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
|
|
|
|
|
2024-02-21 17:54:01 +00:00
|
|
|
ARG PWA_ENABLED="false"
|
|
|
|
|
|
|
|
ENV VITE_PWA_ENABLED=${PWA_ENABLED}
|
|
|
|
|
2022-05-03 16:21:11 +00:00
|
|
|
COPY . ./
|
2023-09-01 13:27:55 +00:00
|
|
|
RUN pnpm run build
|
2022-05-03 16:21:11 +00:00
|
|
|
|
|
|
|
# production environment
|
|
|
|
FROM nginx:stable-alpine
|
2024-01-01 23:44:45 +00:00
|
|
|
COPY --from=build /app/dist /usr/share/nginx/html
|
2022-05-03 16:21:11 +00:00
|
|
|
EXPOSE 80
|
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|