is there an example on how to best run a codeigniter4 application (using php-fpm). I am trying to run castopod. But I am somewhat lost (also because of my lack of PHP knowledge).
Looks like their docker setup splits the web server and the code base (with php-fpm) into 2 containers, which is analogous to 2 apps in Fly.io.
That’s not super necessary but will make it a bit harder to run it all within one app. (You can certainly make it all work within one app - that’s what the Fly Laravel setup is, for example. It will take some manual work getting the Docker setup functional).
The build pack might be the way to go, although i didn’t see one - what build pack are you referring to?
PHP and PHP-FPM don’t listen for HTTP connections directly, so you’ll need Nginx / Apache / Caddyserver (something that listens for HTTP connections and can transform a web request to FastCGI) in front of PHP-FPM.
PHP-FPM “speaks” in FastCGI - it accepts FastCGI requests and spins up PHP processes from them (thus running your app). You need a web server to transform the HTTP request into FastCGI.
So, you do need Nginx / Apache/ Caddyserver (those are just ones I know that can handle FastCGI) in front of a PHP application.
(That being said, give that buildpack a try, it might work! I don’t know the specifics of this application at all - if it has a custom webroot path, for example).
That project appears to have some custom requirements, like ffmpeg, however, so I don’t necessarily think you’ll have a great time with the buildpack
One idea is to use their image castopod/app as your base image, and then install/configure Nginx within it. That might be the easiest path, but involves monkeying with Nginx config and Docker. I’m not sure how familiar you are with all that!