Skip to content

Commit 6ea1747

Browse files
authored
Revert "build(docker): Switch to Docker Hardened Images (DHI) (#214)" (#215)
This reverts commit 8d4b5e2.
1 parent 8d4b5e2 commit 6ea1747

2 files changed

Lines changed: 21 additions & 26 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"]

devservices/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ services:
2525
labels:
2626
- orchestrator=devservices
2727
healthcheck:
28-
test: ["CMD", "node", "-e", "fetch('http://127.0.0.1:9090/api/chartcuterie/healthcheck/live').then(r=>r.ok?0:1,()=>1).then(process.exit)"]
28+
test: python3 -c "import urllib.request; urllib.request.urlopen(\"http://127.0.0.1:9090/api/chartcuterie/healthcheck/live\", timeout=5)"
2929
interval: 5s
3030
timeout: 5s
3131
retries: 3

0 commit comments

Comments
 (0)