fix(docker): switch alpine to node:22-slim for pre-built better-sqlite3
Some checks failed
Build and Push Docker Image / build (push) Failing after 42s
CI / Security audit (push) Has been cancelled

Alpine uses musl libc; better-sqlite3 has no pre-built musl binaries so
it always compiles from source (installs 300 MB of gcc/g++/python3,
takes 3-5 min). node:22-slim (Debian) has glibc so prebuild-install
downloads a pre-built binary instead — build stays under 1 minute.

Changes:
- Both stages: node:22-alpine -> node:22-slim
- deps stage: remove apk/build-tool installation (not needed)
- runtime stage: remove apk libstdc++ install (present in debian-slim)
- HEALTHCHECK: wget -> node built-in http (wget absent from debian-slim)
- docker-compose.yaml: same healthcheck fix
This commit is contained in:
2026-05-17 07:10:41 +01:00
parent 898ca9199b
commit 49327cf9ae
2 changed files with 14 additions and 14 deletions

View File

@@ -35,7 +35,7 @@ services:
- ALL # drop all Linux capabilities
cap_add: [] # add back none — Node.js needs no special caps
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:3001/health"]
test: ["CMD", "node", "-e", "require('http').get('http://localhost:3001/health',r=>{process.exit(r.statusCode===200?0:1)}).on('error',()=>process.exit(1))"]
interval: 30s
timeout: 5s
retries: 3