I am creating an automated deployment with gitlab, and I build my app with docker into an image as described in the docs, but I ran into an issue with migrations. I can't run them on the server cause stuff is missing. I am pretty new to deployment processes, so might not understand things correctly.
So do I need to include my whole project structure in the container including full node_modules so I can run migrations?
Running migrations in the docker build process is one option. I'm thinking your migration code is not included in the final build because there is no reference to them outside of the cli command.
See this documentation for running migrations when the server starts up, which will add the code to the tree and should be included in the build. Or the section above describes how to run migrations before building payload - which will have a smaller size in the end and could be more beneficial.
It worked. Thank you!
Star
Discord
online
Get dedicated engineering support directly from the Payload team.