/docker-php

Production-ready Docker images for PHP. Optimized for Laravel, WordPress, and more!

Primary LanguageDockerfileGNU General Public License v3.0GPL-3.0

Docker Images Logo

Build Status License Support us
Docker Pulls Discourse users Discord

Hi! We're Dan and Jay. We're a two person team with a passion for open source products. We created Server Side Up to help share what we learn.

Find us at:

  • 📖 Blog - get the latest guides and free courses on all things web/mobile development.
  • 🙋 Community - get friendly help from our community members.
  • 🤵‍♂️ Get Professional Help - get guaranteed responses within next business day.
  • 💻 GitHub - check out our other open source projects
  • 📫 Newsletter - skip the algorithms and get quality content right to your inbox
  • 🐥 Twitter - you can also follow Dan and Jay
  • ❤️ Sponsor Us - please consider sponsoring us so we can create more helpful resources

Our Sponsors

All of our software is free an open to the world. None of this can be brought to you without the financial backing of our sponsors.

Sponsors

Individual Supporters

deligoez  alexjustesen  jeremykenedy  

Available Docker Images

This is a list of the docker images this repository creates:

⚙️ Variation 🚀 Version
cli serversideup/php:8.2-cli
serversideup/php:8.1-cli
serversideup/php:8.0-cli
serversideup/php:7.4-cli
fpm serversideup/php:8.2-fpm
serversideup/php:8.1-fpm
serversideup/php:8.0-fpm
serversideup/php:7.4-fpm
fpm-apache serversideup/php:8.2-fpm-apache
serversideup/php:8.1-fpm-apache
serversideup/php:8.0-fpm-apache
serversideup/php:7.4-fpm-apache
fpm-nginx serversideup/php:8.2-fpm-nginx
serversideup/php:8.1-fpm-nginx
serversideup/php:8.0-fpm-nginx
serversideup/php:7.4-fpm-nginx

Usage

Simply use this image name pattern in any of your projects:

serversideup/php:{{version}}-{{variation-name}}

For example... If I wanted to run PHP 8.0 with FPM + NGINX, I would use this image:

serversideup/php:8.0-fpm-nginx

Real-life working example

You can see a bigger picture on how these images are used from Development to Production by viewing this video that shows a high level overview how we deploy "ROAST" which is a demo production app for our book.

Click the image below to view the video:

Laravel + NuxtJS From Dev to production

Updates

✅ The image builds automatically run weekly (Tuesday at 0800 UTC) for latest security updates.

Why these images and not other ones?

These images have a few key differences. These images are:

🚀 These images are used in production

Our philosophy is: What you run in production is what you should be running in development.

You'd be shocked how many people create a Docker image and use it in the local development only. These images are designed with the intention of being deployed to the open and wild Internet.

🧐 Based off of S6 Overlay

S6 Overlay is very helpful in managing a container's lifecycle that has multiple processes.

Wait... Isn't Docker supposed to be a "single process per container"? Yes, that's what it's like in a perfect world. Unfortunately PHP isn't like that. You need both a web server and a PHP-FPM server to see your files in order for your application to load.

We follow the S6 Overlay Philosophy on how we can still get a single, disposable, and repeatable image of our application out to our servers.

🤩 See all the differences

If you're looking to understand more the key differences with these PHP images, check out our documentation site.

Read more about the key differences with these images →

Documentation

We have everything fully documented and available on our website. If you find an issue, everything is located under the /docs folder or the /docs/content folder if you're looking to submit a change to the documentation.

View the Documentation →

Submitting issues and pull requests

Since there are a lot of dependencies on these images, please understand that it can make it complicated on merging your pull request.

We'd love to have your help, but it might be best to explain your intentions first before contributing.

Like we said -- we're always learning

If you find a critical security flaw, please open an issue or learn more about our responsible disclosure policy.