-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't use volumes to share code between nginx & fpm #106
Comments
Also using this will not work for setup that use Kubernetes. There is no way to share out a volume to other containers running. We could setup a PV then copy the items over then share them but that just not clean for upgrades. |
Thanks @gamkiller77, I wan not aware of that behavior in Kubernetes. I am hoping to make some progress here soon, but have been a little short on time recently. |
AFAICT, the only way forward is to produce two images : "cachet-fpm" & "cachet-nginx". |
@djdefi do you have the start of the merge of cachet-nginx? I really want to show this off to my boss as we have a massive use case for this where I work. If you have a branch already in play I can take some time and look to help you. |
@gamkiller77 I dont have a branch currently. I was thinking of just going back to how we had it before #46 and putting nginx, fpm, and the cachet code all in the same image. I am happy to review a PR if you want to take a stab at reverting those changes with the current master. I prob wont be able to work on one myself until later this week. I am ok with doing "one purpose per container" rather than "one process per container". The image's purpose is to display Cachet, so I am 👍 with this. We have supervisord already in there for process spawning. No more volumes to share, and one less container required to be running etc. |
@djdefi I only have 3 days to work this week so i go look at this. I was just thinking just adding the nginx at the end of the supervisor code to bring up the web end. I have more time next week after my wedding anny. |
Resolved in #129 |
I think it's a bad design to use Docker volumes to share PHP source code between nginx & php-fpm containers.
Apart from the "philosophical" perspective which states that application code should leave inside the container and only data should be persisted in volumes, it's also a pain from an operational point of view.
If you want to update Cachet from vX to vY, you can't just change the tag of the image and docker-compose up -d because compose will keep on using the volume created initially, with the code of vX. You have to manually destroy php-fpm (cachet) and nginx containers and recreate it.
Unfortunately, putting application code inside container means, for that use case, building a custom nginx image with the application code, which essentially means maintaining two images.
The other approach would be to provide a unique (simpler) image which combines the web server and the php runtime. It could also be an apache2 + mod_php image.
The text was updated successfully, but these errors were encountered: