-
Notifications
You must be signed in to change notification settings - Fork 0
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
5 changed files
with
5,397 additions
and
7,871 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
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,31 +1,19 @@ | ||
FROM node:20.11.0-bullseye-slim AS builder | ||
|
||
FROM node:20-slim AS base | ||
ENV PNPM_HOME="/pnpm" | ||
ENV PATH="$PNPM_HOME:$PATH" | ||
RUN corepack enable | ||
COPY . /app | ||
WORKDIR /app | ||
|
||
COPY package*.json ./ | ||
COPY prisma ./prisma/ | ||
|
||
RUN npm install | ||
|
||
COPY . . | ||
|
||
RUN npm run build | ||
FROM base AS prod-deps | ||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile | ||
|
||
FROM node:20.11.0-bullseye-slim | ||
|
||
ARG BRANCH="main" | ||
ARG COMMIT="" | ||
LABEL branch=${BRANCH} | ||
LABEL commit=${COMMIT} | ||
|
||
ENV COMMIT_SHA=${COMMIT} | ||
ENV COMMIT_BRANCH=${BRANCH} | ||
|
||
COPY --from=builder /app/node_modules ./node_modules | ||
COPY --from=builder /app/package*.json ./ | ||
COPY --from=builder /app/dist ./dist | ||
COPY --from=builder /app/prisma ./prisma | ||
FROM base AS build | ||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile | ||
RUN pnpm run build | ||
|
||
FROM base | ||
COPY --from=prod-deps /app/node_modules /app/node_modules | ||
COPY --from=build /app/dist /app/build | ||
EXPOSE 3000 | ||
|
||
CMD [ "npm", "run", "start:migrate:prod" ] | ||
CMD [ "pnpm", "start:migrate:prod" ] |
Oops, something went wrong.