Skip to content

Commit cd6beb8

Browse files
authored
Revert "build(docker): Switch to Docker Hardened Images (DHI) (#212)" (#213)
This reverts commit 840b7f7.
1 parent 840b7f7 commit cd6beb8

1 file changed

Lines changed: 20 additions & 25 deletions

File tree

Dockerfile

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,38 @@
1-
FROM us-docker.pkg.dev/sentryio/dhi/node:24-debian13-dev AS builder
1+
FROM node:24.14.0 AS builder
22

3-
WORKDIR /build
4-
5-
COPY package.json yarn.lock ./
3+
COPY package.json yarn.lock .
64
RUN yarn install --frozen-lockfile
75

86
COPY tsconfig.json .
97
COPY src src
108
RUN yarn build
119

12-
# Drop devDependencies from node_modules for the runtime image
13-
RUN yarn install --frozen-lockfile --production
10+
FROM node:24.14.0-slim
1411

15-
# canvas 3.x bundles its graphics libs (libcairo, libpango, etc.) but its
16-
# bundled librsvg/glib still need a few basic system libs absent from the
17-
# minimal runtime image. Collect them here to copy in without pulling the
18-
# entire -dev system into the runtime.
19-
RUN mkdir -p /canvas-sys-libs && \
20-
find /lib /usr/lib -maxdepth 3 \( \
21-
-name "libz.so.1*" -o \
22-
-name "libexpat.so.1*" -o \
23-
-name "libuuid.so.1*" -o \
24-
-name "liblzma.so.5*" \
25-
\) -exec cp -P --parents {} /canvas-sys-libs/ \;
12+
ENV NODE_ENV=production
2613

14+
RUN npm install -g npm@latest \
15+
&& npm cache clean --force
2716

28-
FROM us-docker.pkg.dev/sentryio/dhi/node:24-debian13
29-
30-
ENV NODE_ENV=production
17+
RUN apt-get update && apt-get install -y --no-install-recommends \
18+
build-essential \
19+
libcairo2-dev \
20+
libpango1.0-dev \
21+
libjpeg-dev \
22+
libgif-dev \
23+
librsvg2-dev \
24+
&& rm -rf /var/lib/apt/lists/*
3125

3226
WORKDIR /usr/src/app
3327

34-
COPY package.json ./
28+
COPY package.json yarn.lock ./
29+
RUN yarn install --frozen-lockfile \
30+
&& yarn cache clean
31+
3532
COPY fonts fonts
36-
COPY --from=builder /build/node_modules node_modules
37-
COPY --from=builder /build/lib lib
38-
COPY --from=builder /canvas-sys-libs/ /
33+
COPY --from=builder lib lib
3934

40-
RUN ["node", "lib/index.js", "--help"]
35+
RUN node lib/index.js --help
4136

4237
EXPOSE 9090/tcp
4338
CMD ["node", "./lib/index.js", "server", "9090"]

0 commit comments

Comments
 (0)