I am in the process of moving over some sites in PHP using Slim/Twig to docker containers. In the old server a request came in slim routed the request sent back the html and then the browser made the call to get the resources CSS, images, etc. where apache took over.
Moving to Docker the httpd conf is essentially this:
ProxyPassMatch "^/(.*\.php\/(.*)?)$" "fcgi://php:9000/var/www/html/public/index.php/$2"
Still working all that out but this essentially forwards a request like http://192.168.33.20:8080/index.php/admin to fcgi://php:9000/var/www/html/public/index.php/$2 and Slim picks off all the rest of the path so admin and returns the correct view rendered by twig.
Issue I am running into is the resources. I have most of my css and front-end frameworks in the php application via composer. So the browser makes another call to:
/index.php/vendor/twbs/bootstrap/dist/js/bootstrap.bundle.js HTTP/1.1" 404
Getting a 404 because Slim has no idea what this path is and apache is just forwarding.
What I have looked at and the cons:
Placing the resources on Apache but this basically couple Apache and php like the server was.
Creating a container to server these files ie another non-loadbalancer Apache to server these requests. This still couples and also means I need to find a way to potentially store multiple versions in a blue green deployment.
Mount a volume to the Apache lb. Not sure why I abandoned this one. Probably version issues.
Create a route that can search for the resource. So far my favorite idea but added code complexity.
So the question I have is there a standard way of dealing with this in Docker?