jws-frontend/Dockerfile
2024-06-13 11:17:12 +07:00

26 lines
529 B
Docker

FROM node:20-slim as build-stage
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
WORKDIR /app
COPY . .
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN pnpm run build
FROM alpine as production-stage
WORKDIR /app
RUN apk add miniserve --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
COPY --from=build-stage /app/dist/spa .
COPY --from=build-stage /app/entrypoint.sh ./entrypoint.sh
RUN chmod u+x ./entrypoint.sh
ENTRYPOINT ["./entrypoint.sh"]