- Install certbot in the container instead of the image (download only in the image). It should be like this, since /etc/letsencrypt should be added as a volume. I assume it might break apt install certbot in a new docker compose up -d. - Copy php-fpm pools from host to /etc/php/8.2/fpm/pool.d - Instead of apt-get update, just apt-get install (because packages are already downloaded). - Before installing PHP, check if .conf exist and delete them to avoid DPKG asking for installing maintainer's version. - Code refactor.