Skip to content

Commit a654da6

Browse files
committed
Use node:24-slim in Dockerfile to match verified runtime, add engines field
Both build and production stages pinned to node:22-slim, but node:sqlite's unflagging landed in a later 22.x patch (nodejs/node#55890) and Docker couldn't be verified locally (blocked by a BIOS setting). Switch to node:24-slim to match the Node version this project was actually developed and tested against, removing any uncertainty about which 22.x patch is safe. Also add engines.node >=22.5 to backend/package.json so an unsupported local Node version fails fast with a clear message instead of a confusing node:sqlite import error.
1 parent 228fdf0 commit a654da6

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

‎backend/Dockerfile‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
# ---- Build stage ----
2-
# node:22-slim (not 20): the data layer uses Node's built-in node:sqlite module,
3-
# which requires Node >= 22.5. No C++ toolchain is needed in either stage since
4-
# node:sqlite has no native module to compile.
5-
FROM node:22-slim AS build
2+
# node:24-slim: the data layer uses Node's built-in node:sqlite module, which
3+
# requires Node >= 22.5 (unflagged in a later 22.x patch; see nodejs/node#55890).
4+
# We pin to 24 to match the version this project was actually developed and
5+
# tested against, rather than relying on an unverified 22.x patch release. No
6+
# C++ toolchain is needed in either stage since node:sqlite has no native
7+
# module to compile.
8+
FROM node:24-slim AS build
69
WORKDIR /app
710
COPY package.json package-lock.json ./
811
RUN npm ci
@@ -11,7 +14,7 @@ COPY src ./src
1114
RUN npm run build
1215

1316
# ---- Production stage ----
14-
FROM node:22-slim AS production
17+
FROM node:24-slim AS production
1518
WORKDIR /app
1619
ENV NODE_ENV=production
1720
ENV DB_PATH=/app/data/products.db

‎backend/package.json‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
"name": "product-search-backend",
33
"version": "1.0.0",
44
"type": "module",
5+
"engines": {
6+
"node": ">=22.5"
7+
},
58
"scripts": {
69
"dev": "tsx watch src/index.ts",
710
"build": "tsc -p tsconfig.json",

0 commit comments

Comments
 (0)