I am fairly new to docker and I am still trying to figure out what the best practices and conventions are.
One thing I see over and over again is: "each container should be responsible for just a single process".
I am coming from the average LAMP stack. So one apache server is serving multiple websites running on php, and they all have some cronjobs running (combined in a single cron-file).
So, the docker way... A single container for mysql. A single container for php+apache (can access the mysql container via the 'docker-network'.
But now the cronjobs. I see people saying: you should make a seperate container for that. But, to my knowning, there is no way the cron-container would be able to access the php-command from the php+apache container.
What is the convention here? I feel like I should put the cron in the php+apache container, and just run it as an additional process in that container. Is that correct?
Next to this: should every website have its own docker php+apache+cron container? Or is it 'allowed' to bundle them together?
Any advice? Thanks!