Skip to content

Commit

Permalink
Revert "build: remove buildkit cache"
Browse files Browse the repository at this point in the history
This reverts commit 2a17474.
  • Loading branch information
acifani committed Sep 20, 2024
1 parent 2a17474 commit 576b2e1
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
FROM node:20-slim AS base

ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable

FROM base AS prod

COPY pnpm-lock.yaml /app
COPY . /app
WORKDIR /app
RUN pnpm fetch --prod

COPY . /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 base
COPY --from=prod /app/node_modules /app/node_modules
COPY --from=prod /app/dist /app/dist
COPY --from=prod-deps /app/node_modules /app/node_modules
COPY --from=build /app/dist /app/dist

CMD [ "pnpm", "start:docker" ]

0 comments on commit 576b2e1

Please sign in to comment.