Skip to content

Commit 88d61e4

Browse files
authored
fix: update workers image (#2139)
1 parent 0fb6d41 commit 88d61e4

2 files changed

Lines changed: 20 additions & 25 deletions

File tree

docker/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
FROM node:24.12-bookworm AS base
2+
23
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/*
4+
&& apt-get -y --no-install-recommends install \
5+
sudo curl git ca-certificates build-essential dumb-init \
6+
&& rm -rf /var/lib/apt/lists/*
67

78
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
89
ENV MISE_INSTALL_PATH="/usr/local/bin/mise"

docker/workers.Dockerfile

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,30 @@
11
FROM node:24.12-bookworm AS base
22

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

4-
# -------------------------------------------------------
5-
# get the init system
6-
FROM base AS tools
7-
8-
# update packages and install the minimal init system "dumb-init"
9-
RUN apt-get update && apt-get install -y --no-install-recommends dumb-init
8+
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
9+
ENV MISE_INSTALL_PATH="/usr/local/bin/mise"
1010

11+
# Install mise
12+
RUN curl https://mise.run | sh
1113

1214
# -------------------------------------------------------
1315
FROM base AS build
1416

1517
WORKDIR /app
16-
COPY package.json yarn.lock .yarnrc.yml ./
17-
# We need a specific command because we need to copy the folder with it, not just the content.
18-
COPY .yarn/releases ./.yarn/releases/
19-
RUN yarn set version berry && yarn install --immutable
18+
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml mise.toml ./
19+
20+
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0
21+
RUN mise trust && mise install && corepack enable && pnpm install --frozen-lockfile
2022

2123
ENV NODE_ENV=production
2224
COPY . .
23-
RUN yarn build-ts
24-
25-
# -------------------------------------------------------
26-
FROM base AS deps
27-
28-
WORKDIR /app
29-
COPY package.json yarn.lock .yarnrc.yml ./
30-
# We need a specific command because we need to copy the folder with it, not just the content.
31-
COPY .yarn/releases ./.yarn/releases/
32-
RUN yarn set version berry && yarn workspaces focus --all --production
25+
RUN pnpm build-ts
3326

27+
RUN pnpm install --prod --frozen-lockfile
3428

3529
# -------------------------------------------------------
3630
# Final step that will run the application
@@ -49,10 +43,10 @@ ENV NODE_ENV=production
4943
WORKDIR /app
5044

5145
# Copy the installed dumb-init system from build image
52-
COPY --from=tools /usr/bin/dumb-init /usr/bin/dumb-init
46+
COPY --from=base /usr/bin/dumb-init /usr/bin/dumb-init
5347

5448
# Copy the dependencies and compiled server code
55-
COPY --chown=node:node --from=deps ./app/node_modules ./node_modules
49+
COPY --chown=node:node --from=build ./app/node_modules ./node_modules
5650
COPY --chown=node:node --from=build ./app/dist ./dist
5751

5852
# Set user to be non-root node

0 commit comments

Comments
 (0)