-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
15 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |