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