The original post: /r/php by /u/AlkaKr on 2024-10-10 09:34:07.

I recently purchased a Raspberry Pi 4 so I can host my own projects(currently 2) mostly because DevOps was one of my weakpoints and wanted to get a way better understanding that I already had.

I managed to set it up using one Nginx Container with an external: true network for my laravel app that redirects requests to my laravel container and it works fine.

But I’ve been using the official php:8.3-apache image and I was looking into optimizing it even further like, using something without apache at all and just going for the fpm image instead and I stumbled upon this:

https://serversideup.net/open-source/docker-php/docs/getting-started/these-images-vs-others

I’ve also seen them recommended here a few times but I have a question.

In the link I provided above, they say they are “Production ready” but they contain composer as well.

Why would anyone need composer in production. Shouldn’t you just build an image with all of the necessary files (Like in a multi-stage build) and deploy that?

What am I missing?