Since last fall, I spent over 500 hours revamping our infrastructure to use Docker + Gitlab CI for our deployments. During this process, I also wrote my own PHP images and made them freely available on Github:
# Why these images and not other ones?
**These images are used in production**
What you run in development is what you should run in production. These images are designed and hardened to run on the open, wild Internet. I used a lot of knowledge that I gained in /u/fideloper's "Shipping Docker" course and incorporated that knowledge into these images.
**Say goodbye to Supervisor configs!**
PHP is unique where it requires PHP-FPM and a web server (like NGINX or Apache) to be available in a single container. Many people cringe reading that, but you need to do this if you want your entire application to be packaged and versioned in a single image.
Some images use Supervisor, but Supervisor was not specifically designed for containers. Instead, I chose [S6 Overlay](https://github.com/just-containers/s6-overlay) which is designed from the ground up to run within the lifecycle of a container. This gives us a clearer picture if our service is running and is healthy.
**Stupid-simple configurations for Laravel Horizon, Queues, and Task Schedulers**
Since S6 Overlay replaces Supervisor, this means you don't even need to worry about supervisor configs for Laravel Horizon, Queues, or Task Schedulers. It' just as [simple as passing your command](https://github.com/serversideup/docker-php#runing-a-laravel-task-scheduler).
**Automated tasks executed on start up**
I optimized common tasks at start up that you can enable/disable depending on your needs:
1. Automated database migrations
2. Automated storage linking
**Tons of customizations with environment variables**
I have every environment variable fully documented so you can easily customize the image at a per-app basis.
# Real-life working example
Sharing these images is just one slice of the entire picture when it comes to the DevOps process. I also have a video available where I give a very high-level overview of what "development to production" looks like: [https://www.youtube.com/watch?v=PInGAWnvkjM](https://www.youtube.com/watch?v=PInGAWnvkjM)
I hope you find this resource as a solid contribution to the Laravel Community and helpful for your own projects. As always, if you have any questions or constructive feedback, I would love to hear your thoughts!
If you like what I have, there are a a lot of other tools that I wrote that I'd love to share with you to make your app building process easier.
Keep on building great things! 😎