fix(docker): switch alpine to node:22-slim for pre-built better-sqlite3
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user