# Root cause of the node-pty "Cannot find module .../pty.node" failure (Phase 2A): with no # .dockerignore, a host-side `npm install` (e.g. for local testing) leaves backend/node_modules # on disk, built against the host's own Node/libnode — not the container's. The Dockerfile's # later `COPY backend/ ./backend/` (done after the npm-install RUN layer, for build caching) # then silently overwrites the correctly-built-in-container node_modules with that host copy, # which fails to load at runtime with an ABI/architecture mismatch. Native modules (node-pty, # better-sqlite3) MUST always be built inside the image, never leaked in from the host. # # IMPORTANT: bare `node_modules/` only matches a node_modules directory at the build context # ROOT in Docker's .dockerignore matching rules — it does NOT recursively match # backend/node_modules or frontend/node_modules. This bit us once already (fixed here with # `**/`): a first pass at this file used the bare pattern and the leak still happened. **/node_modules/ frontend/dist/ .git/ *.db *.db-journal