How to seed a DB for a docker stack

This doesn’t cover docker stacks. What’s the best way to seed a db for a docker stack?

Hi Nadav!

You can use a build_command to run that - these will run on your host directly, running inside a temporary container created for the command. This should allow you to seed your database.


Actually, I see that you want to run the command outside of the container. You will be able to do this with a deploy hook soon, but in the meantime I’d suggest that you run it manually on the host for a one-off command like this. Please note that the server won’t have PSQL packages though, so perhaps it’s better if you run it inside your container.

I’ll just run it on the PostgreSQL server for now. It should have the psql package as well.


You must be logged in to answer this question