4 ms·
The article touches on this towards the end, but I think the Docker (or container) way would be to create separate containers for each process. I could very wel
by gexla 13y ago
The article touches on this towards the end, but I think the Docker (or container) way would be to create separate containers for each process. I could very well be wrong on this though. I'm still trying to figure out the best way to use containers.
One container would contain the Drupal files along with an Nginx or Apache process.
One container would run PHP (probably PHP-FPM.)
One container would contain MySQL.
This would allow for better scaling options. You could then run multiple containers for PHP processes and have the web server do a round robin between PHP containers. You could do the same for the container which has the Drupal files and put a load balancer in front of them. Any file based caching options would probably be best switched to something like Memcache so that the cached items are in sync.I suppose some content management systems would better accommodate this setup than others.
I'm not sure yet the best way to do development in the above setup. I suppose one way would be to run an SSH server on the Drupal container and then perhaps mount the files you need access to as a drive using SSHFS or something. I haven't played with this yet, but you can also create volumes on the host OS to be shared with the container (I think I got that right.) Perhaps you could share the files that you need access to.
Am I right on this? Does anyone else do things differently? This project moves so fast it's hard to keep up with.
Edit: I also wonder if containers create a performance hit for MySQL. You would also need make backups. Maybe you would be better off running a big DB on its own dedicated server / VPS outside a container?
I would also save all user generated files (for something like Drupal, this would be mostly images) to something like S3.