Skip to content

Commit 9b6a940

Browse files
committed
Update to node:24-slim
1 parent 5ad25d7 commit 9b6a940

3 files changed

Lines changed: 6 additions & 7 deletions

File tree

Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
FROM node:22-alpine AS base
1+
FROM node:24-slim AS base
22

33
# This will be set by the GitHub action to the folder containing this component.
44
ARG FOLDER=/app
55

66
# Install dependencies only when needed
77
FROM base AS deps
8-
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
9-
RUN apk add --no-cache libc6-compat
108

119
COPY . /app
1210
WORKDIR ${FOLDER}

Dockerfile.dev

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
# This will be set by the GitHub action to the folder containing this component.
22
ARG FOLDER=/app
33

4-
FROM node:22-alpine
5-
6-
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
7-
RUN apk add --no-cache libc6-compat
4+
FROM node:24-slim
85

96
COPY . /app
107
WORKDIR ${FOLDER}

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,7 @@ Will run `npm install` when component is first initialized, and `npm run dev` wh
3333
### Production
3434

3535
Will build a production ready image. Image runs `npm install` & `npm build` when being created. Once the image runs, `npm start` is called.
36+
37+
### Notes
38+
39+
- If you are using packages that use native libraries (like `node-canvas` e.g.), it is a good idea to switch the `Dockerfile` and `Dockerfile.dev` to use `node:XX` instead of `node:XX-slim`. You can also add any missing libraries with `RUN apt update && apt install -y <package>` in the dockerfiles.

0 commit comments

Comments
 (0)