To make the start-up procedure simpler and more foolproof. The postCreateCommand will only be ran once after the container is built or re-built, and will not be ran after you start or reconnect the container. So we can gracefully place the composer install at this entry to ensure every newcomer or new container is ready to use out of the box.
And we can save a little build time by copying the composer executable from the official image. But since we don't want to bundle the vendor directory into the app image(or may be improved next time), we actually do not need multiple- stage build and just leave it for scalable.
But even so, you still need to execute compose update when you need to update deps locally. This is feasible for advanced developers, as they want to care about the flarum extensions, the php library, and so on.
postCreateCommand
will only be ran once after the container is built or re-built, and will not be ran after you start or reconnect the container. So we can gracefully place thecomposer install
at this entry to ensure every newcomer or new container is ready to use out of the box.compose update
when you need to update deps locally. This is feasible for advanced developers, as they want to care about the flarum extensions, the php library, and so on.