|
1 | | -FROM us-docker.pkg.dev/sentryio/dhi/node:24-debian13-dev AS builder |
| 1 | +FROM node:24.14.0 AS builder |
2 | 2 |
|
3 | | -WORKDIR /build |
4 | | - |
5 | | -COPY package.json yarn.lock ./ |
| 3 | +COPY package.json yarn.lock . |
6 | 4 | RUN yarn install --frozen-lockfile |
7 | 5 |
|
8 | 6 | COPY tsconfig.json . |
9 | 7 | COPY src src |
10 | 8 | RUN yarn build |
11 | 9 |
|
12 | | -# Drop devDependencies from node_modules for the runtime image |
13 | | -RUN yarn install --frozen-lockfile --production |
| 10 | +FROM node:24.14.0-slim |
14 | 11 |
|
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 |
26 | 13 |
|
| 14 | +RUN npm install -g npm@latest \ |
| 15 | + && npm cache clean --force |
27 | 16 |
|
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/* |
31 | 25 |
|
32 | 26 | WORKDIR /usr/src/app |
33 | 27 |
|
34 | | -COPY package.json ./ |
| 28 | +COPY package.json yarn.lock ./ |
| 29 | +RUN yarn install --frozen-lockfile \ |
| 30 | + && yarn cache clean |
| 31 | + |
35 | 32 | 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 |
39 | 34 |
|
40 | | -RUN ["node", "lib/index.js", "--help"] |
| 35 | +RUN node lib/index.js --help |
41 | 36 |
|
42 | 37 | EXPOSE 9090/tcp |
43 | 38 | CMD ["node", "./lib/index.js", "server", "9090"] |
0 commit comments