-
Notifications
You must be signed in to change notification settings - Fork 455
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
Add new image flavor with Alpine + PHP-FPM + Nginx #346
Comments
There's not a way to create such a thing without adding some kind of process supervisor, right? That brings a lot of other problems with it, unfortunately. 😞 |
See also docker-library/php#54 (and linked issues) for more discussion around this. |
I am not sure you need any supervisor, here is my working example: https://github.com/sudo-bot/gh-deployer-container/blob/main/docker/Dockerfile For me, as I do in my Docker images: the fpm service runs in background and then nginx service runs in foreground as the last command run |
Thanks :) |
In that example, /bin/sh is the (very poor 😬) supervisor.
|
Yes, you need a supervisor and I recommend s6. It's really lightweight, can spawn several processes (2 in this case), can restart failing tasks (it's configurable), can redirect stdout/stderr of all processes to the docker log, etc... Update: I can open a PR if you are willing to consider making it official. |
Oh, I did not think it like that but now that you say that it's obvious s6 looks very cool and does not depend on an orgy of python things I just read the thread and am not sure about the conclusion |
There is already a |
That's true, best we can do is support back decompressing phpmyadmin into the www folder to make fpm/nginx setups work |
Official-images should not be using a process supervisor. It should be "one process" per container; this keeps things consistent, composable, and (hopefully) scalable. Similar, now closed issue of adding a Apache2 + |
Thank you for all your comments, it will be easier to reply to newer questions now We should document and example with fpm and nginx like roundcube mail does: https://github.com/roundcube/roundcubemail-docker/blob/master/examples/docker-compose-fpm-alpine.yaml |
I just built a tiny Docker image for phpPgAdmin. It should work for phpMyAdmin just changing the download URL in the Dockerfile and adding missing php extensions. Feel free to copy the code or whatever you want.
That is true, but, since this is an administrative tool and hence, it is not critical in a production environment we can make an exception in favor of convenience. I guarantee you that all the software packaged in that image is solid rock. It also manages stdout/stderr of all processes, clean restarts, clean shutdowns... all of it in 12 MB of disk and 10 MB of RAM, no external dependencies. |
sounds fine. Current image is fat and has many unnecessary packages, don't know why intermediate php image is not using slim variant. I also prefer fully working alpine version, web-server don't matter (nginx, apache2 or lighttpd). |
Can you point me to which Debian-based variant of PHP isn't using the |
ups sorry, you are right, slim images are in use, but adding all the packages later. |
Right, which is why |
Oops, sorry, got myself confused with Alpine where re-installing them is fast, they do get kept on Debian builds for |
@tianon is providing an alpine version going to be accepted in the official repository? |
Unfortunately, https://github.com/sudo-bot/gh-deployer-container/blob/7f72d26f3a971cde2a5b3ee046b13c2980e97493/docker/docker-entrypoint.sh#L99-L101 is going to a be no-go. 🙈 |
Yeah 😄, there is probably an apache way for this ;) |
I struggle to use use the image proposed by @ngosang with the PR #144, as I'm running the container with nobody user and read-only.
The config.inc.php changes are :
I think s6 is too hard to use with nobody user, whereas supervisord is running fine. |
Here is custom solution: https://hub.docker.com/r/beeyev/phpmyadmin-lightweight This project is built on top of the official phpMyAdmin fpm-alpine image, it includes Caddy webserver (instead of nginx) and extra dark themes. Compressed size is just 61.56 MB |
Thanks for this, some notes about your project
|
i just replaced the fat image with this and runs out of the box with 1/3 of the size and even faster. |
We should probably try to do an apache2 alpine variant |
Here's my version (nginx + php-fpm) : https://framagit.org/colibris-xyz/phpmyadmin-docker Very simple, built on top of the official image, automatically updated. |
I would perfer that users do not use different images that are not officially supported by phpmyadmin itself I am glad to see images created by users, but there is quite a lot of ways to make an image that is not perfect or insecure |
I can do that. |
Because of this comment: #346 (comment) Docker Official registry images can only have one process running 🤷 PS: I also prefer nginx |
You are not giving the users what they want...
I think you have to be pragmatic here. The advantages of having an image with Alpine + S6 + PHP-FPM + Nginx are huge even if you are breaking that rule.
|
Hi all, I did have an idea to avoid the current multi process policy issue, maybe we can use https://frankenphp.dev/ |
I don't understand how Apache can be included in the image with FPM, but Nginx cannot. Isn't Apache also a separate process? |
because Apache2 is the one and single process the container is running. And FPM+Nginx requires some 3rd tool to watch over them and start them. So they are not a single process. |
First of all, thank you for providing Docker images.
Currently I'm using the "apache" flavor because I don't have an external web server. My only complain is the image is heavy.
I think it will be easy to extend the "fpm-alpine" image to include a Nginx server. The total size will be similar to "fpm-alpine", about 1 / 3 of the size of "apache" image.
The text was updated successfully, but these errors were encountered: