Skip to content

Commit

Permalink
switch from pnpm to npm
Browse files Browse the repository at this point in the history
  • Loading branch information
AmruthPillai committed Nov 14, 2023
1 parent 277bb2a commit 8ae9215
Show file tree
Hide file tree
Showing 6 changed files with 34,941 additions and 20,523 deletions.
4 changes: 0 additions & 4 deletions .husky/commit-msg

This file was deleted.

20 changes: 7 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,31 @@ WORKDIR /app

ARG NX_CLOUD_ACCESS_TOKEN

ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"

RUN corepack enable

# --- Build Image ---
FROM base AS build

ENV NX_CLOUD_ACCESS_TOKEN=$NX_CLOUD_ACCESS_TOKEN

COPY .npmrc package.json pnpm-lock.yaml ./
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN npm ci && npm cache clean --force

COPY . .

RUN pnpm build
RUN npm run build

# --- Release Image ---
FROM base AS release

RUN apt update && apt install -y dumb-init --no-install-recommends

COPY --chown=node:node --from=build /app/dist ./dist
COPY --chown=node:node --from=build /app/.npmrc /app/package.json /app/pnpm-lock.yaml ./
RUN npm ci --production && npm cache clean --force

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

# Copy Build Output
COPY --chown=node:node --from=build /app/dist ./dist
# Copy Prisma Generated Client
COPY --chown=node:node --from=build /app/node_modules/.prisma ./node_modules/

COPY --chown=node:node --from=build /app/node_modules/.prisma/client ./node_modules/.prisma/client
# Copy Prisma Schema & Migrations
COPY --chown=node:node --from=build /app/tools/prisma ./tools/prisma

CMD [ "dumb-init", "pnpm", "start" ]
CMD [ "dumb-init", "node", "dist/apps/server/main" ]
Loading

0 comments on commit 8ae9215

Please sign in to comment.