generated from amosproj/amos202Xss0Y-projname
-
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
1 parent
93c585a
commit e3866d1
Showing
2 changed files
with
37 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
FROM node:20-alpine as base | ||
|
||
ENV PNPM_HOME="/pnpm" | ||
ENV PATH="$PNPM_HOME:$PATH" | ||
RUN corepack enable | ||
|
||
WORKDIR /usr/src/app | ||
|
||
RUN corepack prepare pnpm@8.15.1 --activate | ||
|
||
FROM base as installer | ||
|
||
COPY package.json ./ | ||
COPY pnpm-lock.yaml ./ | ||
|
||
RUN pnpm install --frozen-lockfile --prod | ||
|
||
FROM base as builder | ||
|
||
ENV NX_DEAMON="false" | ||
|
||
COPY --from=installer /usr/src/app/node_modules ./node_modules | ||
|
||
COPY . . | ||
|
||
RUN pnpm install --frozen-lockfile | ||
RUN pnpm nx build backend | ||
|
||
FROM node:20-alpine as production | ||
|
||
COPY --from=installer /usr/src/app/node_modules ./node_modules | ||
COPY --from=builder /usr/src/app/dist/apps/backend ./dist/ | ||
|
||
EXPOSE 3000 | ||
EXPOSE 9229 | ||
|
||
CMD ["node", "./dist/main.js"] |
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