Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM node:24.12-bookworm AS base

RUN apt-get update \
&& apt-get -y --no-install-recommends install \
sudo curl git ca-certificates build-essential dumb-init \
&& rm -rf /var/lib/apt/lists/*
&& apt-get -y --no-install-recommends install \
sudo curl git ca-certificates build-essential dumb-init \
&& rm -rf /var/lib/apt/lists/*

SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ENV MISE_INSTALL_PATH="/usr/local/bin/mise"
Expand Down
38 changes: 16 additions & 22 deletions docker/workers.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,36 +1,30 @@
FROM node:24.12-bookworm AS base

RUN apt-get update \
&& apt-get -y --no-install-recommends install \
sudo curl git ca-certificates build-essential dumb-init \
&& rm -rf /var/lib/apt/lists/*

# -------------------------------------------------------
# get the init system
FROM base AS tools

# update packages and install the minimal init system "dumb-init"
RUN apt-get update && apt-get install -y --no-install-recommends dumb-init
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ENV MISE_INSTALL_PATH="/usr/local/bin/mise"

# Install mise
RUN curl https://mise.run | sh

# -------------------------------------------------------
FROM base AS build

WORKDIR /app
COPY package.json yarn.lock .yarnrc.yml ./
# We need a specific command because we need to copy the folder with it, not just the content.
COPY .yarn/releases ./.yarn/releases/
RUN yarn set version berry && yarn install --immutable
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml mise.toml ./

ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0
RUN mise trust && mise install && corepack enable && pnpm install --frozen-lockfile

ENV NODE_ENV=production
COPY . .
RUN yarn build-ts

# -------------------------------------------------------
FROM base AS deps

WORKDIR /app
COPY package.json yarn.lock .yarnrc.yml ./
# We need a specific command because we need to copy the folder with it, not just the content.
COPY .yarn/releases ./.yarn/releases/
RUN yarn set version berry && yarn workspaces focus --all --production
RUN pnpm build-ts

RUN pnpm install --prod --frozen-lockfile

# -------------------------------------------------------
# Final step that will run the application
Expand All @@ -49,10 +43,10 @@ ENV NODE_ENV=production
WORKDIR /app

# Copy the installed dumb-init system from build image
COPY --from=tools /usr/bin/dumb-init /usr/bin/dumb-init
COPY --from=base /usr/bin/dumb-init /usr/bin/dumb-init

# Copy the dependencies and compiled server code
COPY --chown=node:node --from=deps ./app/node_modules ./node_modules
COPY --chown=node:node --from=build ./app/node_modules ./node_modules
COPY --chown=node:node --from=build ./app/dist ./dist

# Set user to be non-root node
Expand Down
Loading