📜 Description
Problem
In Dockerfile.dev, the CMD runs nginx && pnpm run pm2. Nginx listens on port 5000 immediately, while pm2-run still runs prisma db push first. Until Nest listens on 3000, location /api/ in nginx proxies to localhost:3000 and returns 502. That lasts for the whole Prisma phase.
For Kubernetes (or any orchestrator) this is awkward: HTTP probes to :5000/api/ see 502 even when the container is “healthy” for its real phase (migrating the DB).
Suggested direction
- Run
prisma db push before nginx so nothing accepts on :5000 until after migration (or at least avoid nginx serving /api/ during Prisma).
- Split “migrate + start apps” so the container CMD can run:
prisma → nginx → start PM2 apps without running Prisma twice.
I have a patch that adds a pm2-run-apps script (pnpm filters for backend/frontend/orchestrator only) and changes CMD to pnpm run prisma-db-push && nginx && pnpm run pm2-run-apps. Happy to open a PR if this matches your goals.
Environment
- Image built from
Dockerfile.dev (production-style container with nginx + PM2).
👟 Reproduction steps
Above
👍 Expected behavior
Dockerfile CMD: prisma-db-push → nginx → pm2-run-apps (was nginx first, which exposed :5000 during migration and caused 502 on /api/ until Nest was up).
👎 Actual Behavior with Screenshots
💻 Operating system
Linux
🤖 Node Version
node:22.20-bookworm-slim
📃 Provide any additional context for the Bug.
No response
👀 Have you spent some time to check if this bug has been raised before?
Are you willing to submit PR?
Yes I am willing to submit a PR!
📜 Description
Problem
In
Dockerfile.dev, the CMD runsnginx && pnpm run pm2. Nginx listens on port 5000 immediately, whilepm2-runstill runsprisma db pushfirst. Until Nest listens on 3000,location /api/in nginx proxies tolocalhost:3000and returns 502. That lasts for the whole Prisma phase.For Kubernetes (or any orchestrator) this is awkward: HTTP probes to
:5000/api/see 502 even when the container is “healthy” for its real phase (migrating the DB).Suggested direction
prisma db pushbeforenginxso nothing accepts on :5000 until after migration (or at least avoid nginx serving/api/during Prisma).prisma→nginx→ start PM2 apps without running Prisma twice.I have a patch that adds a
pm2-run-appsscript (pnpm filters for backend/frontend/orchestrator only) and changes CMD topnpm run prisma-db-push && nginx && pnpm run pm2-run-apps. Happy to open a PR if this matches your goals.Environment
Dockerfile.dev(production-style container with nginx + PM2).👟 Reproduction steps
Above
👍 Expected behavior
Dockerfile CMD: prisma-db-push → nginx → pm2-run-apps (was nginx first, which exposed :5000 during migration and caused 502 on /api/ until Nest was up).
👎 Actual Behavior with Screenshots
💻 Operating system
Linux
🤖 Node Version
node:22.20-bookworm-slim
📃 Provide any additional context for the Bug.
No response
👀 Have you spent some time to check if this bug has been raised before?
Are you willing to submit PR?
Yes I am willing to submit a PR!