Skip to content

Commit

Permalink
fix: Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
DevNono committed May 16, 2024
1 parent bd35f66 commit 405ed0b
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions web/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
ARG NODE_VERSION=19-alpine
FROM node:${NODE_VERSION} AS base
RUN npm install -g pnpm

FROM node:${NODE_VERSION}

WORKDIR /usr/src/app
FROM base AS builder
WORKDIR /usr/srv/app

COPY --chown=node:node package.json pnpm-lock.yaml ./

RUN npm i -g pnpm && pnpm install --frozen-lockfile --prod=false
RUN pnpm install --frozen-lockfile

COPY --chown=node:node . .

RUN pnpm prisma generate && pnpm build

ENV NODE_ENV production
FROM base AS runner
WORKDIR /usr/srv/app
ENV NODE_ENV=production

COPY --from=builder --chown=node:node /usr/srv/app/package.json /usr/srv/app/pnpm-lock.yaml ./

RUN pnpm install --frozen-lockfile --prod

RUN pnpm install -P
COPY --from=builder --chown=node:node /usr/srv/app/build ./

RUN chown node:node .
USER node

CMD pnpm start
CMD ["node", "server.js"]

0 comments on commit 405ed0b

Please sign in to comment.