Skip to content

Commit

Permalink
yarn build in dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
lukesthl committed Oct 14, 2023
1 parent cfae1a3 commit 08c70b2
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions apps/api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
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
RUN yarn install --production

FROM base AS build
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN pnpm run build
RUN yarn build

FROM base
COPY --from=prod-deps /app/node_modules /app/node_modules
COPY --from=build /app/dist /app/dist
EXPOSE 3000
CMD [ "pnpm", "start:prod" ]
CMD [ "yarn", "start:prod" ]

0 comments on commit 08c70b2

Please sign in to comment.