-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: ajust docker compose and dockerfile
- Loading branch information
Showing
2 changed files
with
36 additions
and
18 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,25 +1,39 @@ | ||
FROM node:22 AS build | ||
FROM node:22 AS base | ||
|
||
ENV PNPM_HOME="/pnpm" | ||
ENV PATH="$PNPM_HOME:$PATH" | ||
|
||
WORKDIR /usr/src/app | ||
|
||
RUN npm install -g pnpm@8 | ||
RUN corepack enable && corepack prepare pnpm@8.6.0 --activate | ||
|
||
COPY ./package.json ./pnpm-lock.yaml ./ | ||
|
||
COPY ./ . | ||
|
||
RUN pnpm install --frozen-lockfile -r | ||
FROM base AS prod-deps | ||
|
||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile | ||
|
||
FROM base AS build | ||
|
||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile | ||
RUN npx prisma generate | ||
RUN pnpm build | ||
|
||
FROM node:22-alpine3.19 | ||
|
||
ENV PNPM_HOME="/pnpm" | ||
ENV PATH="$PNPM_HOME:$PATH" | ||
|
||
|
||
RUN corepack enable && corepack prepare pnpm@8.6.0 --activate | ||
|
||
|
||
WORKDIR /usr/src/app | ||
RUN npm install -g pnpm@8 | ||
COPY --from=build /usr/src/app/package.json ./package.json | ||
COPY --from=build /usr/src/app/build ./build | ||
COPY --from=build /usr/src/app/node_modules ./node_modules | ||
COPY --from=prod-deps /usr/src/app/node_modules ./node_modules | ||
|
||
EXPOSE 3000 | ||
|
||
CMD ["pnpm", "run", "start"] | ||
CMD ["pnpm", "start"] |
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