Skip to content

fix(docker): make sqlite3 native build explicit and fail fast - #96

Open
thetelgote wants to merge 1 commit into
docker:mainfrom
thetelgote:fix/sqlite3-bindings-issue-92
Open

fix(docker): make sqlite3 native build explicit and fail fast#96
thetelgote wants to merge 1 commit into
docker:mainfrom
thetelgote:fix/sqlite3-bindings-issue-92

Conversation

@thetelgote

Copy link
Copy Markdown

Summary

This PR improves the sqlite3-build stage in the Dockerfile by making the native addon build process explicit and adding an early verification step.

Changes

  • Install the native build toolchain (python3, make, g++) explicitly in the sqlite3-build stage instead of relying on the upstream node:22 image.
  • Continue rebuilding the sqlite3 native binding using node-gyp.
  • Add a build-time check that verifies node_modules/sqlite3/build/Release/node_sqlite3.node exists.
  • Fail the Docker build with a clear error if the native binary is not produced.

Why

Previously, the Docker build relied on the base image implicitly providing the required compilation tools. If the native binding failed to build, the error only appeared later during the test stage as:

- Pin python3/make/g++ explicitly in the sqlite3-build stage instead of
  relying on the base node:22 image's incidental toolchain.
- Add a build-time check that the compiled .node binary actually exists
  where sqlite3/bindings.js expects it, so a broken compile fails loudly
  at build time instead of surfacing as a cryptic 'Could not locate the
  bindings file' error deep in the test stage (issue docker#92).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant