Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Running migrations on deployed instance

default discord avatar
bohdanchornopolskyi7 months ago
2

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?

  • default discord avatar
    arstoien_399187 months ago

    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.



    https://payloadcms.com/docs/database/migrations#running-migrations-in-production
  • default discord avatar
    bohdanchornopolskyi7 months ago

    It worked. Thank you!

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.