How to run migrations with docker?

I managed to get my app deployed using docker thanks to the official docs.
It’s all working nice but one thing is missing; migrations are not run at any point in the deployment process.
I was wondering how people run migrations automatically using docker.
I couldn’t find anything helpful in the docs and in the forum so if anyone has any advice I would appreciate it very much.

1 Like

You can either run yarn rw prisma migrate deploy and yarn rw prisma generate in the api_build step, or you can run them in the api_serve step by adding the redwood cli to your serve environment first with yarn add @redwoodjs/cli.

I think in most cases it’s better to do it during the api_build step, but it depends on your deployment setup and when/how your builds are being triggered.