Skip to content

Commit

Permalink
fix(docker): move docker to pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
NuttyShrimp committed Jul 6, 2024
1 parent 7891ab8 commit 2961603
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
FROM node:20-alpine AS base

WORKDIR /src

COPY --link package.json yarn.lock .
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 builder

RUN yarn install --frozen-lockfile

COPY . .
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile

RUN yarn prisma generate
RUN pnpm prisma generate

RUN yarn run build
RUN pnpm run build

FROM base

ENV NODE_ENV=production

COPY --from=builder /src/.output /src/.output
COPY --from=builder /src/.nuxt /src/.nuxt
COPY --from=builder /src/prisma /src/prisma
COPY --from=builder /app/.output /src/.output
COPY --from=builder /app/.nuxt /src/.nuxt
COPY --from=builder /app/prisma /src/prisma

RUN yarn global add prisma

CMD [ "yarn", "start"]
CMD [ "pnpm", "start"]

0 comments on commit 2961603

Please sign in to comment.