
Composer in Docker: best practices for production images
I published this guide today, which explains some of the best practices for building production-ready Docker images for your PHP applications which use Composer to install dependencies.
This includes using Composer without leaving the binary in your production image, running the composer install command with the correct flags, excluding your local vendor directory from the build context, optimizing cache to speed up consecutive builds, optimizing the Composer autoloader, and passing authentication credentials to Composer to install packages from private registries.
https://nth-root.nl/en/guides/composer-in-docker-best-practices-for-production-images
u/nicwortel — 7 days ago