Skip to content

Commit

Permalink
build: remove buildkit cache
Browse files Browse the repository at this point in the history
  • Loading branch information
acifani committed Sep 20, 2024
1 parent 626bcde commit 2a17474
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
FROM node:20-slim 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 prod

FROM base AS build
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
COPY pnpm-lock.yaml /app
WORKDIR /app
RUN pnpm fetch --prod

COPY . /app
RUN pnpm run build

FROM base
COPY --from=prod-deps /app/node_modules /app/node_modules
COPY --from=build /app/dist /app/dist
COPY --from=prod /app/node_modules /app/node_modules
COPY --from=prod /app/dist /app/dist

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

0 comments on commit 2a17474

Please sign in to comment.