You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Question] Serving fpm-alpine image with nginx #253
without that line, phpmyadmin is being extracted and inside /var/www/html/
So, it seems, the mount of that directory is later than the Dockerfile RUN scripts are executed and downloading and extracting phpmyadmin.
Is there any solution for that?
Maybe changing the nginx config block?
Why do you want to have a volume?
a seperate nginx container and this phpmyadmin-fpm container need to share the document root with the phmyadmin contents, otherwise it will not work. fpm can only serve php files, so nginx need to handle css/js/html files (all other stuff)
Please have a look f.ex. at the nextcloud project and get some ideas there.
They are doing all the magic inside the docker-entrypoint.sh file: First extracting the source files to /usr/src/nextcloud and then doing some rsync to /var/www/html https://github.com/nextcloud/docker/blob/master/docker-entrypoint.sh
You could do the same.
There is no need to do all the magic inside the Dockerfile :)
@pzystorm do you also have an Nginx service in your docker-compose.yml file, that is using the same phpmyadmin volume?
If that is the case, it's possible that the Nginx container is the first to start, initialising the volume as an empty folder. If you make sure the phpMyAdmin container starts first with depends_on, that might fix your issue:
Working correctly phpmyadmin-fpm container with nginx container, if volumes sections of these are set to "phpmyadmin: /var/www/html" (NOT ./phpmyadmin: /var/www/html). But in advance, need to create the external volume by the following command: "$ docker volume create --name=phpmyadmin".
when I run my docker compose file I'm getting this weird rendering of phpmyadmin:fpm-alpine, I tried different web browsers and clearing the cache but the issue is the same:
Since you are using the config I made, it should work. It could be the contents of the volume.
Could you check the contents of the volume ? js/dist folder should exist and each theme should have css files in the css folder
Since you are using the config I made, it should work. It could be the contents of the volume.
Could you check the contents of the volume ? js/dist folder should exist and each theme should have css files in the css folder
Hi William,
I found how to fix this, I just have to add this line to the http block in the nginx.conf file: include /etc/nginx/mime.types;
Since you are using the config I made, it should work. It could be the contents of the volume.
Could you check the contents of the volume ? js/dist folder should exist and each theme should have css files in the css folder
Hi William,
I found how to fix this, I just have to add this line to the http block in the nginx.conf file: include /etc/nginx/mime.types;
Thank you so much for letting me know and anyone searching about this !
Activity
williamdes commentedon Oct 18, 2019
@lonix1 try port
9000on hostphpmyadminforfastcgi_passsince you are sending the script to the cgi and not to the web serverIf it does not work comment back here :)
lonix1 commentedon Oct 18, 2019
@williamdes Thanks - yes you are right it should be
9000! I edited it above.However, it still does not work :-(
curl http://www.example.com/pmagives:The docker log shows:
williamdes commentedon Oct 18, 2019
maybe you should change
/var/www/htmlto/usr/src/phpmyadminSee: https://github.com/phpmyadmin/docker/blob/master/fpm-alpine/Dockerfile#L77
I assume you have data into the volume
phpmyadmin_datahttps://superuser.com/a/435969/609233
I would write the nginx config block like that
You are maybe missing the rewrite part since the files are in the root folder and not in
/pmalonix1 commentedon Oct 18, 2019
When I do
docker-compose upfor the first time, it saysThat's why I used that path. But even if I use
/usr/src/phpmyadminit fails with same error. I checked that there are files in there, looks okay.I tried the new
locationblock also. Same error (file not found).Does that actually work for you?
I will carry on fiddling to get it working. Maybe we can then add it to the docs.
williamdes commentedon Oct 18, 2019
After hours (since my last post) I could not make a rewrite folder that worked.Light version
williamdes commentedon Oct 18, 2019
Using a proxy
Using CGI
Thanks to: https://stackoverflow.com/a/29213330/5155484
@lonix1 the CGI version is what you want
lonix1 commentedon Oct 19, 2019
@williamdes wow thanks! I used the "Using CGI" section, and got it working finally, but on the wrong path:
curl http://www.example.com/pmagives404but
curl http://www.example.com/gives the phpmyadmin login pageBTW, I assume your "Using a proxy" section is for the
latestimage, and "Using CGI" is for thefpm-alpineandfpmimages?williamdes commentedon Oct 19, 2019
I think you are correct on what you assume
@lonix1 can you paste your final configuration?
I made it work with the
^~and position can be important from what Internet sayslonix1 commentedon Oct 20, 2019
Okay I got it to work, thanks to this!
Notes:
PMA_ABSOLUTE_URI- not sure why?This should be in the docs. If someone knows how to do that, please add @williamdes' code for
latestimage and my code forfpm-alpineandfpmimages.lonix1 commentedon Oct 20, 2019
@williamdes BTW thanks for taking the time to help me... Appreciated!
williamdes commentedon Oct 20, 2019
@lonix1 I think it is because all files need to know their base path?
lonix1 commentedon Oct 20, 2019
@williamdes Yes... so we need to correctly set
SCRIPT_FILENAME.williamdes commentedon Oct 20, 2019
@lonix1 please post the config when you have a working example ;)
25 remaining items
pzystorm commentedon Sep 1, 2020
Argh... the problematic line is:
without that line, phpmyadmin is being extracted and inside /var/www/html/
So, it seems, the mount of that directory is later than the Dockerfile RUN scripts are executed and downloading and extracting phpmyadmin.
Is there any solution for that?
williamdes commentedon Sep 2, 2020
Maybe changing the nginx config block?
Why do you want to have a volume?
pzystorm commentedon Sep 2, 2020
a seperate nginx container and this phpmyadmin-fpm container need to share the document root with the phmyadmin contents, otherwise it will not work. fpm can only serve php files, so nginx need to handle css/js/html files (all other stuff)
williamdes commentedon Sep 2, 2020
I would suggest you to have a look to the configuration of @woosungchoi #299 (comment)
pzystorm commentedon Sep 2, 2020
it's the same. because of the volume (which is mounted when starting and not when building), the folder /var/www/html is empty at first startup
The container itself is ok. So the only thing to do is to rerun the steps from the Dockerfile:
https://github.com/phpmyadmin/docker/blob/master/fpm-alpine/Dockerfile#L78-L101
williamdes commentedon Sep 2, 2020
I understand, you are talking about #284 (comment) on #285
pzystorm commentedon Oct 17, 2020
Please have a look f.ex. at the nextcloud project and get some ideas there.
They are doing all the magic inside the docker-entrypoint.sh file: First extracting the source files to /usr/src/nextcloud and then doing some rsync to /var/www/html
https://github.com/nextcloud/docker/blob/master/docker-entrypoint.sh
You could do the same.
There is no need to do all the magic inside the Dockerfile :)
williamdes commentedon Oct 17, 2020
Hi @pzystorm
Could you open a pull-request here so we can discuss and review the change you need please?
osteel commentedon Oct 23, 2020
@pzystorm do you also have an Nginx service in your
docker-compose.ymlfile, that is using the samephpmyadminvolume?If that is the case, it's possible that the Nginx container is the first to start, initialising the volume as an empty folder. If you make sure the phpMyAdmin container starts first with
depends_on, that might fix your issue:capitalfuse commentedon Jan 21, 2021
Working correctly phpmyadmin-fpm container with nginx container, if volumes sections of these are set to "phpmyadmin: /var/www/html" (NOT ./phpmyadmin: /var/www/html). But in advance, need to create the external volume by the following command: "$ docker volume create --name=phpmyadmin".
SergeShkurko commentedon Jan 22, 2021
Site located at /* and phpmyadmin located at /phpmyadmin
phpMyAdmin location /var/www/html/ reqired
other site can be located at /var/www/site_name
I resolve problem with same configs:
default.conf
gitown commentedon Sep 15, 2021
when I run my docker compose file I'm getting this weird rendering of phpmyadmin:fpm-alpine, I tried different web browsers and clearing the cache but the issue is the same:

Here is my docker-compose.yml:
And my Nginx Dockerfile:
And finally my nginx.conf:
Any idea what's causing this issue?
williamdes commentedon Sep 16, 2021
Since you are using the config I made, it should work. It could be the contents of the volume.
Could you check the contents of the volume ?
js/distfolder should exist and each theme should have css files in the css foldergitown commentedon Sep 18, 2021
Hi William,
I found how to fix this, I just have to add this line to the http block in the nginx.conf file:
include /etc/nginx/mime.types;williamdes commentedon Sep 18, 2021
Thank you so much for letting me know and anyone searching about this !