3.0 postgres - Next.js Standalone mode not possible #7310
Replies: 1 comment 4 replies
-
Hey @yobottehg — thanks for bringing this up! Here are some thoughts on this one. You're right in that Next.js standalone mode does not bundle the dependencies necessary for Payload's CLI to work. This is because Payload's CLI is meant to be able to parse your raw TS Payload config. We do this with So the options here are as follows: Run migrations after buildYou can adjust the Dockerfile to run migrations after the build step, where you have full access to all Don't use standalone modeYou can also just disable standalone mode if you 1000% want to run migrations at runtime, in your production Docker image. You will definitely need to have a larger production image though, in that case, due to the fact that you'll need to run Payload's CLI and Drizzle's CLI. HOWEVER, all of this being said, the team and I have been brainstorming in regards to a way to run migrations programmatically, from I think we could achieve that as a feature that we would build in the future. Here's what would need to happen in order to allow running migrations from your production code:
That would be the most ideal way to allow running Payload migrations at runtime. In the meantime, if you absolutely need to run migrations at runtime / server start in production, you should just disable standalone mode for now. But if you can get away with running migrations at build time, then simply update the command your I will convert this to a feature request as we want to track it and make sure that we are in a position to support this in the future. Thanks for bringing it up! |
Beta Was this translation helpful? Give feedback.
-
Link to reproduction
No response
Payload Version
3.0
Node Version
20 LTS
Next.js Version
15 canary 58
Describe the Bug
As per discussion in Discord opening a separate issue for this:
Problem:
.bin
directory is missing so it's not possible to callpayload mgirate
Some more details in this comment:
#7050 (comment)
And this Discord discussion:
https://discord.com/channels/967097582721572934/1262348369293213798
Reproduction Steps
Adapters and Plugins
db-postgres
Beta Was this translation helpful? Give feedback.
All reactions