Prisma cannot run in webapp Docker runner stage#173
Prisma cannot run in webapp Docker runner stage#173seansica wants to merge 16 commits intohijohnnylin:mainfrom
Conversation
|
@hijohnnylin Just so you know, the The workflow tries to use the production runner Docker stage (which has no node_modules) while mounting local dev files into the container for hot-reloading and running This fails because the runner stage is minimal and only contains the Next.js standalone build. When you mount local files, you're overriding the container's filesystem, but The volume mounts in The Docker dev workflow is essentially trying to hybrid local development files with a production container, creating path mismatches and missing dependencies. I'm proposing we abandon this approach and delete the corresponding Makefile recipe and If you're onboard, I can remove |
|
Interesting, thanks!
We should unbreak this immediately, even if it’s not the “cleanest”
solution.
If we remove the local docker webapp, does this basically remove our
ability to bring up the whole environment (including postgres, etc) with
docker locally?
…On Fri, Sep 26, 2025 at 9:56 AM Sean Sica ***@***.***> wrote:
*seansica* left a comment (hijohnnylin/neuronpedia#173)
<#173 (comment)>
@hijohnnylin <https://github.com/hijohnnylin> Just so you know, the make
webapp-localhost-dev workflow does not work. It hasn't worked since we
refactored the webapp's Dockerfile a while back.
The workflow tries to use the production runner Docker stage (which has no
node_modules) while mounting local dev files into the container for
hot-reloading and running npm run dev (which includes prisma generate &&
next dev).
This fails because the runner stage is minimal and only contains the
Next.js standalone build. When you mount local files, you're overriding the
container's filesystem, but npm run dev needs the Prisma CLI to run prisma
generate - which the production container doesn't have since it lacks
node_modules.
The volume mounts in compose.webapp.dev.yaml attempt to work around this
by mounting local node_modules, but the paths don't align correctly with
where the container expects them (/app vs /app/apps/webapp).
The Docker dev workflow is essentially trying to hybrid local development
files with a production container, creating path mismatches and missing
dependencies.
I'm proposing we abandon this approach and delete the corresponding
Makefile recipe and compose.webapp.dev.yaml file in favor of just running npm
run dev:localhost locally - much cleaner and simpler. The production
workflow (make webapp-localhost-run) works fine because it uses the
purpose-built production container that just serves the app.
If you're onboard, I can remove compose.webapp.dev.yaml and the
webapp-localhost-dev makefile recipe in this PR. Just let me know.
—
Reply to this email directly, view it on GitHub
<#173 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAH6NERAIXGRBW3V3A4R2K33UVV3PAVCNFSM6AAAAACHTMWFSSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTGMZZGYZDIMRQGU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
The latest commit should resolve the issue. It does so exactly as described in the previous comment—by breaking the
Thus, there will be four distinct recipes:
In addition, all prisma related steps (generating, pushing, etc.) are now isolated to the |
…-in-webapp-docker-runner-stage
…-in-webapp-docker-runner-stage
…-in-webapp-docker-runner-stage
- create singleton importPool for reuse across all imports - default to ssl false for internal postgres and add runtime ssl handling - reduce WORK_MEM from 2GB to 256MB - add 10 min timeout for queries - enhance logging Changes made as part of troubleshooting K8S deployment issue where model imports fail without reason



prisma db pushis executed byinit.shin the webapp runner stage (at container runtime) but it will fail (without crashing)This is because node_modules is not available in the runner stage, since we are copying from the builder stage which generates a production build via
npm ci.Instead, we should run
prisma db pushin the db-init stage. That stage already has node_modules available, and it keeps database operations in the db-init stage where Prisma CLI is available. It also keeps the production container minimal and focused, and voids the Next.js routing issues.Additionally, we should reference all binaries through node_modules (not
npx). Tool calling throughnpxmay result in version mismatches.