If composer stops the container, it could mean it sends signal to the main process. If it happens during the update before finishing it, I can imagine memory issue, but it should not exit with 0 in that case.
During development, you can move the vendor folder to a volume and mount it to an other container which runs composer. In production, I would not run composer update at all. I would create an image that contains everything.
I just realized something, what is your goal here?
Because when you run composer update as CMD, it shoud exit when it completes, because the program you asked it to run, is complete.
i belive you need to change your composer update to a RUN instead of CMD.
CMD (together with entrypoint) defines what should run when the container starts, if your goal is to mount a folder and update its contents, and then exit, then i guess it will work?
But if you plan to make a webserver in that container, this wont work, you then need to set CMD to something like “php -S 0.0.0.0:8080”
Thanks @rimelek for your answer
I just needed to RUN instead of CMD…
For the automation, i was thinking about composer install (not update) to install all the php packages required for the application