Hi, I’m wondering if there are any ecto mix tasks for two things:
Check if a database has been created before running mix ecto.create in a docker container
Check if a table has been created before running mix ecto.migrate in a docker container.
If not, can someone please tell me how to run this as an entrypoint shell script?
A common way to do it was simply doing
ENTRYPOINT ["mix", "do", "ecto.create,", "ecto.migrate,", "phx.server"] (replace the last one with the actual task that starts your application.
This will run ecto.create and ecto.migrate every single time I do a docker-compose up, which in turn does a compile for each of these commands, how do I reduce the number of compiles. I do not want to compile 3 times every time I do docker-compose up
Perhaps you should show us a bit more info about how you build and start your containers? compose file included.