mirror of
https://github.com/TxtDot/webder.git
synced 2024-12-05 02:36:21 +03:00
27 lines
No EOL
655 B
Docker
27 lines
No EOL
655 B
Docker
FROM node:20-alpine as base
|
|
ENV PNPM_HOME="/pnpm"
|
|
ENV PATH="$PNPM_HOME:$PATH"
|
|
RUN corepack enable
|
|
COPY . /app
|
|
WORKDIR /app
|
|
|
|
FROM base AS prod-deps
|
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
|
|
|
|
FROM base AS build
|
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
|
|
RUN pnpm run build
|
|
|
|
FROM node:20-alpine as run
|
|
|
|
ENV PNPM_HOME="/pnpm"
|
|
ENV PATH="$PNPM_HOME:$PATH"
|
|
RUN corepack enable
|
|
WORKDIR /app
|
|
|
|
COPY --from=prod-deps /app/node_modules /app/node_modules
|
|
COPY --from=build /app/dist /app/dist/
|
|
COPY --from=build /app/package.json /app/package.json
|
|
|
|
EXPOSE 8080
|
|
CMD [ "pnpm", "start" ] |