Hello,
this is more of a general question on how others use their PHP-FPM docker containers in production in conjunction with Caddy.
The main question is how do you share static files between seperate Caddy and PHP containers if you prebuild the php-fpm container bundled with the code in CI/CD?
What most “solutions” to the problem are, is to put the code onto the server and mount it into both the Caddy container and the PHP container.
Others suggest to put Caddy into the PHP-FPM container with the code and serve it in a bundle. (I’m currently doing this). Having a PHP-FPM container with caddy in it feels kind of bad to me because I don’t want to manage caddy in my own container.
Using Caddy with the reverse_proxy directive to send the requests to a normal Apache/PHP container was very slow in my tests.
I would appreciate learnings or best practices from others how you handle PHP apps in production environments.
Best regards, Markus