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
fpm-alpine & volume (-v) leads to empty /var/www/html (Apache2) #395
Sorry to raise this issue, but I have a problem using the fpm-alpine container with Apache2 installed on the host machine. I have the following line in my Apache2 to redirect *.php requests to fpm:
This works well. The real problem are the resource files (CSS, JS), I usually use a volume to make them accessible through the host file system like this:
And then I would add this line in Apache2 to serve the resource files through the container:
Alias /phpMyAdmin /var/www/phpmyadmin
But when I mount a volume like this, the /var/www/html directory in the container is empty. There is also no /usr/src/phpmyadmin directory, only the /usr/src/php.tar.xz file exists.
This approach worked for me for other containers based on php-fpm-alpine, I don't know what is special about phpMyAdmin that it doesn't work here. So can anyone help me on howto setup this correctly?
And yes, I asked this question on Stackoverflow but I didn't get any response there.
tar -xf phpMyAdmin.tar.xz -C /var/www/html --strip-components=1; \
) ,can you share your docker compose file?
I am currently thinking that there is no need to volume mount, and after that maybe it could be a local path issue sending the request to fpm
This works well. The real problem are the resource files (CSS, JS), I usually use a volume to make them accessible through the host file system like this:
Okay I get it, it works but no files are recognized by apache2 as tbey do not exist on the host file system
Hmm, maybe run the apache2 version and proxy the http traffic to it?
Issue #362 seems to be the same issue. I use plain docker, so I don't have a docker compose file and Apache2 doesn't run within docker, but directly on the host system.
My understanding at this point is, Dockerfile-alpine.template extracts directly to /var/www/html and if this is part of a mounted volume (-v), the extraction doesn't work and /var/www/html is empty.
I think the steps to reproduce the problem are simple, start the container with a mount to /var/www/html:
This is what docker logs shows in case of postfixadmin:
Postfixadmin not found in /var/www/html - copying now...
WARNING: /var/www/html is not empty - press Ctrl+C now if this is an error!
...
Complete! Postfixadmin has been successfully copied to /var/www/html
I need access to the resource files, since fpm couldn't serve these files directly, this would result in following errors for any non php files:
172.17.0.1 - 31/Jan/2023:22:03:22 +0000 "GET /phpMyAdmin/index.php" 200
172.17.0.1 - 31/Jan/2023:22:03:22 +0000 "GET /phpMyAdmin/themes/pmahomme/jquery/jquery-ui.css" 403
NOTICE: Access to the script '/var/www/html/themes/pmahomme/jquery/jquery-ui.css' has been denied (see security.limit_extensions)
NOTICE: Access to the script '/var/www/html/js/vendor/codemirror/lib/codemirror.css' has been denied (see security.limit_extensions)
Activity
williamdes commentedon Jan 31, 2023
Hi!
Where did you see something about
/usr/src?It's
/var/www/html(docker/fpm/Dockerfile
Line 106 in d1f327e
I am currently thinking that there is no need to volume mount, and after that maybe it could be a local path issue sending the request to fpm
Okay I get it, it works but no files are recognized by apache2 as tbey do not exist on the host file system
Hmm, maybe run the apache2 version and proxy the http traffic to it?
williamdes commentedon Jan 31, 2023
This relates to #362
All this was caused by #285
williamdes commentedon Jan 31, 2023
Can you link the stackoverflow.com post?
AndreasFagschlunger commentedon Jan 31, 2023
/usr/src/phpmyadminwas mentioned here: #253 (comment)Stackoverflow post is here: https://stackoverflow.com/questions/75268068/problem-with-static-files-using-phpmyadminfpm-alpine-behind-apache2
Issue #362 seems to be the same issue. I use plain docker, so I don't have a docker compose file and Apache2 doesn't run within docker, but directly on the host system.
My understanding at this point is,
Dockerfile-alpine.templateextracts directly to/var/www/htmland if this is part of a mounted volume (-v), the extraction doesn't work and/var/www/htmlis empty.I think the steps to reproduce the problem are simple, start the container with a mount to
/var/www/html:And then check the
/var/www/htmldirectory on the container, it's empty:Run the container without mount (-v) and all the files are there:
e.g., I also use postfixadmin which is small but similar in the structure:
The Dockerfile seems to extract everything to
/usr/src/postfixadminhttps://github.com/postfixadmin/docker/blob/master/fpm-alpine/Dockerfile
Where the
docker-entrypoint.shthen copies everything to/var/www/htmlhttps://github.com/postfixadmin/docker/blob/master/fpm-alpine/docker-entrypoint.sh
This is what
docker logsshows in case ofpostfixadmin:I need access to the resource files, since fpm couldn't serve these files directly, this would result in following errors for any non php files: