11FROM node:24.12-bookworm AS base
2+ RUN apt-get update \
3+ && apt-get -y --no-install-recommends install \
4+ sudo curl git ca-certificates build-essential dumb-init \
5+ && rm -rf /var/lib/apt/lists/*
6+
7+ SHELL ["/bin/bash" , "-o" , "pipefail" , "-c" ]
8+ ENV MISE_INSTALL_PATH="/usr/local/bin/mise"
9+
10+ # Install mise
11+ RUN curl https://mise.run | sh
212
313
414# #############################
515# ## Build Application Step ###
616# #############################
717# This step will build the application
8- FROM base AS tools
9-
10- # update packages and install the minimal init system "dumb-init"
11- RUN apt-get update && apt-get install -y --no-install-recommends dumb-init
18+ # FROM base AS tools
1219
20+ # # update packages and install the minimal init system "dumb-init"
21+ # RUN apt-get update \
22+ # && apt-get install -y --no-install-recommends dumb-init \
23+ # && rm -rf /var/lib/apt/lists/*
1324
1425# -------------------------------------------------------
1526FROM base AS build
1627
1728WORKDIR /app
18- COPY package.json yarn. lock .yarnrc.yml ./
19- # We need a specific command because we need to copy the folder with it, not just the content.
20- COPY .yarn/releases ./.yarn/releases/
21- RUN yarn set version berry && yarn install --immutable
29+ COPY package.json pnpm- lock.yaml pnpm-workspace.yaml mise.toml ./
30+
31+ ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0
32+ RUN mise trust && mise install && corepack enable && pnpm install --frozen-lockfile
2233
2334ENV NODE_ENV=production
2435COPY . .
25- RUN yarn build-ts
36+ RUN pnpm build-ts
2637
27- # -------------------------------------------------------
28- FROM base AS deps
29-
30- WORKDIR /app
31- COPY package.json yarn.lock .yarnrc.yml ./
32- # We need a specific command because we need to copy the folder with it, not just the content.
33- COPY .yarn/releases ./.yarn/releases/
34- RUN yarn set version berry && yarn workspaces focus --all --production
38+ # removes non prod dependencies
39+ RUN pnpm install --prod --frozen-lockfile
3540
3641# ###########################
3742# ## Run Application Step ###
@@ -54,10 +59,10 @@ EXPOSE 3000
5459WORKDIR /app
5560
5661# Copy the installed dumb-init system from build image
57- COPY --from=tools /usr/bin/dumb-init /usr/bin/dumb-init
62+ COPY --from=base /usr/bin/dumb-init /usr/bin/dumb-init
5863
5964# Copy the dependencies and compiled server code
60- COPY --chown=node:node --from=deps ./app/node_modules ./node_modules
65+ COPY --chown=node:node --from=build ./app/node_modules ./node_modules
6166COPY --chown=node:node --from=build ./app/dist ./dist
6267
6368# Set user to be non-root node
0 commit comments