Skip to content

Commit dce583c

Browse files
authored
Merge branch 'main' into setup-nightwatch-healthchecks
2 parents be72983 + f7cd1d7 commit dce583c

File tree

19 files changed

+596
-275
lines changed

19 files changed

+596
-275
lines changed

docs/content/docs/1.getting-started/1.index.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Introduction
3-
description: 'serversideup/php is an alternate approach to the official Docker images provided by PHP. Compared to the defaults provided by the official PHP Docker images, the serversideup/php Docker images are optimized for more real-world and production use cases and an easier developer experience.'
3+
description: 'Production-ready PHP Docker images built on official PHP. Optimized for security, performance, and developer experience.'
44
---
55

66
::hero-video
@@ -13,7 +13,7 @@ src: https://docker-php-public-assets.serversideup.net/docker-demo.mp4
1313

1414
:badges
1515

16-
**serversideup/php** is a "batteries included" approach to the official Docker images provided by PHP. Compared to the defaults provided by the official PHP Docker images, the **serversideup/php** Docker images are optimized for more real-world and production use cases and give you an easier developer experience.
16+
**serversideup/php** takes the official PHP Docker images and adds everything you need for production: better security, performance optimizations, and a developer experience that just works.
1717

1818
## These images are very different from other PHP Docker Images
1919
::u-page-grid
@@ -126,12 +126,12 @@ src: https://docker-php-public-assets.serversideup.net/docker-demo.mp4
126126
:::
127127
::
128128

129-
This is just an overview. See the full list of benefits and features below.
129+
<br />
130130

131-
:u-button{to="/docs/getting-started/these-images-vs-others" label="Read more about the advantages" aria-label="Read more about the advantages" size="md" color="primary" variant="outline" trailing-icon="i-lucide-arrow-right" class="font-bold ring ring-inset ring-blue-600 text-blue-600 hover:ring-blue-500 hover:text-blue-500"}
131+
:u-button{to="/docs/getting-started/these-images-vs-others" label="See all advantages" aria-label="Read more about the advantages" size="md" color="primary" variant="outline" trailing-icon="i-lucide-arrow-right" class="font-bold ring ring-inset ring-blue-600 text-blue-600 hover:ring-blue-500 hover:text-blue-500"}
132132

133-
## Why should I use these PHP Docker Images?
133+
## Ready to get started?
134134

135-
These images are production-ready and optimized for performance and security. We work hard to give you a "batteries included" experience so you can ship PHP with Docker as fast as possible. Click below to see a simple working example.
135+
Ship PHP applications faster with a production-ready setup that includes everything you need out of the box.
136136

137137
:u-button{to="/docs/getting-started/installation" label="Installation" aria-label="Installation" size="md" color="primary" variant="outline" trailing-icon="i-lucide-arrow-right" class="font-bold ring ring-inset ring-blue-600 text-blue-600 hover:ring-blue-500 hover:text-blue-500"}

docs/content/docs/4.deployment-and-production/1.container-basics.md renamed to docs/content/docs/1.getting-started/2.container-basics.md

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,28 @@ title: Container Basics
33
description: 'Learn the basics of containers with PHP and how to use it to deploy your PHP applications.'
44
---
55

6+
## Why even care about containers?
7+
8+
If you're new to Docker or containers, you might be wondering why you should containerize your application in the first place. The short answer: **containers let you run your application anywhere** — from your laptop to any cloud provider — with zero changes.
9+
10+
Key benefits of containerization:
11+
- **Consistency** - Your app runs the same on Mac, Windows, Linux, and production
12+
- **Confidence** - Infrastructure as code means easier testing and rollbacks
13+
- **Freedom** - No vendor lock-in; migrate hosts with minimal effort
14+
- **Simplicity** - Scaling from 1 to 100 containers is straightforward
15+
16+
There are some important terms to understand when working with containers:
17+
18+
| Term | Definition |
19+
|------|------------|
20+
| Container | A running instance of an image. |
21+
| Image | A template for a container to start with (ie. `serversideup/php:8.4-frankenphp`). |
22+
| Tag | A specific version of an image (ie. `8.4-frankenphp`). |
23+
| Registry | A repository of images. This is where users can pull images from to start a container. This can be places like [Docker Hub](https://hub.docker.com/r/serversideup/php) or [GitHub Packages](https://github.com/serversideup/docker-php/pkgs/container/php). |
24+
| Volume | A directory on your host machine that is mounted into a container. This allows you to share files between your host machine and the container. |
25+
| Port | Ports are virtual numbers organizing network data traffic, directing it to the correct application on a device. If you want to expose traffic to work with `http://localhost`, you would map port `80` on your host machine to port `8080` on the container. |
26+
| Environment Variable | A variable that is set in the container's environment. This allows you to configure the container's behavior. |
27+
628
## What are containers?
729
Containers are isolated environments that can run on any host. They are a great way to package your application and all of its dependencies into a single unit that can be easily deployed to any environment.
830

@@ -52,7 +74,32 @@ This is why switching from PHP 8.3 to 8.4 in the installation guide was so fast
5274
Image tags like `8.3-fpm-nginx` and `8.4-frankenphp` aren't just version numbers — they describe the entire stack that's included in that image. The tag tells you the PHP version and which variation (web server stack) you're getting.
5375
::
5476

55-
## Key container concepts
77+
## Key concepts
78+
79+
### Service names
80+
A **service** in Docker Compose is a named container definition. Think of it as a label for a specific part of your application — like your web server, database, or cache. Each service runs in its own container and can be managed independently.
81+
82+
In your `compose.yml`, when you define a service called `php`, you're telling Docker Compose "this is my PHP application server." You can name it anything you want — we use `php` to keep it simple, but `web`, `app`, or `backend` would work just as well.
83+
84+
```yml [compose.yml] {2}
85+
services:
86+
php:
87+
image: serversideup/php:8.4-fpm-nginx
88+
ports:
89+
- 80:8080
90+
```
91+
92+
Whenever you run commands, you'll need to reference the service name you gave it.
93+
94+
```bash [Terminal]
95+
docker compose run php php -v
96+
```
97+
98+
If you named your service `app`, you would run the following command:
99+
100+
```bash [Terminal]
101+
docker compose run app php -v
102+
```
56103

57104
### Volumes: Sharing files with containers
58105
When you added this to your `compose.yml`:
@@ -154,6 +201,6 @@ The `-f` flag in `docker compose logs -f` means "follow" — it keeps showing ne
154201
::
155202

156203
## What's next?
157-
Now that you understand the fundamentals of containers, you're ready to learn how to take your application from development to production. Our next guide walks you through the entire journey, showing you how to package your application properly and deploy it with confidence.
204+
Now that you understand the fundamentals of containers, let's create your first containerized PHP project.
158205

159-
:u-button{to="/docs/deployment-and-production/development-to-production" label="Development to Production Guide" aria-label="Development to Production Guide" size="md" color="primary" variant="outline" trailing-icon="i-lucide-arrow-right" class="font-bold ring ring-inset ring-blue-600 text-blue-600 hover:ring-blue-500 hover:text-blue-500"}
206+
:u-button{to="/docs/getting-started/installation" label="Create your first Docker PHP project" aria-label="Create your first Docker PHP project" size="md" color="primary" variant="outline" trailing-icon="i-lucide-arrow-right" class="font-bold ring ring-inset ring-blue-600 text-blue-600 hover:ring-blue-500 hover:text-blue-500"}

docs/content/docs/1.getting-started/3.installation.md

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -9,39 +9,11 @@ title: Installation
99
`serversideup/php` is compatible with any container orchestrator that supports Docker images (Kubernetes, Docker Swarm, Docker Compose, HashiCorp Nomad, etc.). All images are hosted on [DockerHub](https://hub.docker.com/r/serversideup/php) and [GitHub Packages](https://github.com/serversideup/docker-php/pkgs/container/php) for free. Containers default to running Debian, but Alpine images are also available.
1010
::
1111

12-
## Understanding containers and Docker
13-
14-
::tip
15-
New to containers? Check out our [Container Basics guide](/docs/deployment-and-production/container-basics) for a beginner-friendly introduction to Docker and containerization.
12+
## Quick Start
13+
::tip{to="/docs/getting-started/container-basics"}
14+
New to containers? Check out our [Container Basics guide](/docs/getting-started/container-basics) for a beginner-friendly introduction to Docker and containerization.
1615
::
1716

18-
If you're new to Docker or containers, you might be wondering why you should containerize your application in the first place. The short answer: **containers let you run your application anywhere** — from your laptop to any cloud provider — with zero changes.
19-
20-
Key benefits of containerization:
21-
- **Consistency** - Your app runs the same on Mac, Windows, Linux, and production
22-
- **Confidence** - Infrastructure as code means easier testing and rollbacks
23-
- **Freedom** - No vendor lock-in; migrate hosts with minimal effort
24-
- **Simplicity** - Scaling from 1 to 100 containers is straightforward
25-
26-
There are some important terms to understand when working with containers:
27-
28-
| Term | Definition |
29-
|------|------------|
30-
| Container | A running instance of an image. |
31-
| Image | A template for a container to start with (ie. `serversideup/php:8.4-frankenphp`). |
32-
| Tag | A specific version of an image (ie. `8.4-frankenphp`). |
33-
| Registry | A repository of images. This is where users can pull images from to start a container. This can be places like [Docker Hub](https://hub.docker.com/r/serversideup/php) or [GitHub Packages](https://github.com/serversideup/docker-php/pkgs/container/php). |
34-
35-
If you'd like to learn more about containers, you can learn more following the guide below.
36-
37-
:u-button{to="/docs/deployment-and-production/container-basics" label="Learn More About Containers" aria-label="Learn More About Containers" size="md" color="primary" variant="outline" trailing-icon="i-lucide-arrow-right" class="font-bold ring ring-inset ring-blue-600 text-blue-600 hover:ring-blue-500 hover:text-blue-500"}
38-
39-
## Already using Docker?
40-
If you're already using the official PHP images, switching will literally take you seconds.
41-
42-
:u-button{to="/docs/guide/migrating-from-official-php-images" label="Learn how to migrate from the official PHP images" aria-label="Learn how to migrate from the official PHP images" size="md" color="primary" variant="outline" trailing-icon="i-lucide-arrow-right" class="font-bold ring ring-inset ring-blue-600 text-blue-600 hover:ring-blue-500 hover:text-blue-500"}
43-
44-
## Quick Start
4517
In order to run containers, we need a container engine installed such as Docker. You can follow [Docker's installation guide](https://docs.docker.com/get-started/get-docker/) to get started. Confirm Docker is working by running these commands in your terminal:
4618
```bash [Terminal]
4719
# Check Docker version

docs/content/docs/1.getting-started/2.these-images-vs-others.md renamed to docs/content/docs/1.getting-started/4.these-images-vs-others.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -232,19 +232,19 @@ Don't just take our word for it. Here's what developers are experiencing:
232232
::
233233

234234
**Time Savings**
235-
- ⏱️ **Minutes vs Hours** - Go from zero to production-ready PHP in minutes, not hours of server configuration
236-
- 🔄 **Consistent Deployments** - Eliminate "works on my machine" debugging sessions
237-
- 📦 **Pre-configured** - Stop researching optimal PHP settings for Laravel
235+
- **Minutes vs Hours** - Go from zero to production-ready PHP in minutes, not hours of server configuration
236+
- **Consistent Deployments** - Eliminate "works on my machine" debugging sessions
237+
- **Pre-configured** - Stop researching optimal PHP settings for Laravel
238238

239239
**Better Security**
240-
- 🛡️ **Hardened by Default** - Security best practices built-in, not bolted on
241-
- 🔒 **Regular Updates** - Based on official PHP images with security patches
242-
- 📋 **Audit Trail** - Infrastructure as code means every change is tracked
240+
- **Hardened by Default** - Security best practices built-in, not bolted on
241+
- **Regular Updates** - Based on official PHP images with security patches
242+
- **Audit Trail** - Infrastructure as code means every change is tracked
243243

244244
**Happier Developers**
245-
- 😊 **Simple Configuration** - Environment variables instead of config file archaeology
246-
- 🚀 **Modern Tools** - FrankenPHP, native health checks, and container-native features
247-
- 🤝 **Community Support** - Active community and comprehensive documentation
245+
- **Simple Configuration** - Environment variables instead of config file archaeology
246+
- **Modern Tools** - FrankenPHP, native health checks, and container-native features
247+
- **Community Support** - Active community and comprehensive documentation
248248

249249
## Making the Switch
250250

docs/content/docs/1.getting-started/4.choosing-an-image.md renamed to docs/content/docs/1.getting-started/5.choosing-an-image.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -122,20 +122,14 @@ In October 2025, NGINX stopped supporting NGINX Unit and archived the project. N
122122

123123
The Unit variation uses NGINX Unit as an application server that runs everything in a single process. Since NGINX Unit is no longer maintained, consider migrating to FrankenPHP for a single-process alternative.
124124

125-
## Operating System
125+
## Operating Systems
126126
Choosing an operating system comes down to a few preferences, but ultimately you need to make sure your dependencies are available for the operating system you choose.
127127

128128
| Operating System | Description |
129129
|-----------|-------------|
130130
| `debian` (default) | Debian is a popular Linux distribution that is known for its stability and reliability. It is the default operating system for our images. |
131131
| `alpine` | Alpine is a lightweight Linux distribution that is known for its small size and low resource usage. |
132132

133-
### Debian
134-
Debian is a popular Linux distribution that is known for its stability and compatibility. It is the default operating system for our images.
135-
136-
### Alpine
137-
Alpine is a lightweight Linux distribution that is known for its small size and low resource usage. If you're an advanced user, Alpine may be an excellent choice for you.
138-
139133
### Specific versions
140134
::note
141135
Not all operating systems are available for all image variations and PHP versions. Double check [Docker Hub](https://hub.docker.com/r/serversideup/php/tags){target="_blank"} and [GitHub Packages](https://github.com/serversideup/docker-php/pkgs/container/php){target="_blank"} for the most accurate list of available tags.

docs/content/docs/1.getting-started/5.default-configurations.md renamed to docs/content/docs/1.getting-started/6.default-configurations.md

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,21 @@ layout: docs
1212
All values are defaulted to improve security and performance. We also spent the time to carefully review official documentation and include packages that are required specifically for Laravel and WordPress.
1313

1414
## Unprivileged by Default
15-
All images default to running as the OS-native `www-data` user.
1615

17-
::note
18-
The `www-data` UID/GID is different between Debian (`33:33`) and Alpine (`82:82`). We left these values alone to make these images as native as possible. If you switch between Debian and Alpine, you may need to adjust file permissions in your Docker image and volume mounts.
19-
::
16+
All images default to running as the OS-native `www-data` user instead of `root`. This is a critical security practice that limits what an attacker can do if they compromise your container.
17+
18+
### Why this matters
19+
Running as a non-root user means:
20+
21+
- **Better security**: If someone exploits a vulnerability in your app, they can't gain root access to your container or host system
22+
- **Production-ready**: This follows Docker and Kubernetes security best practices
23+
- **Easier compliance**: Many security policies require non-root containers
2024

21-
Since these images are not privileged, that means they are not running on ports less than 1024:
25+
### What this means for you
26+
Running unprivileged has two practical implications you should know about:
27+
28+
#### Different ports for web servers
29+
On Linux systems, only root can bind to ports below 1024 (like 80 and 443). Since our containers don't run as root, they use higher port numbers by default:
2230

2331
| **Variation** | **Default Ports** |
2432
|---------------|-------------------|
@@ -29,15 +37,35 @@ Since these images are not privileged, that means they are not running on ports
2937
| unit | HTTP: 8080, HTTPS: 8443 |
3038
| frankenphp | HTTP: 8080, HTTPS: 8443 |
3139

32-
### How do I run these services on ports 80 and/or 443?
33-
Almost everyone will want to run these services on ports 80 and 443. If you have an advanced setup, you can use a reverse proxy like Caddy or Traefik to handle the SSL termination and forward the traffic to the container on the non-privileged port.
40+
#### File permissions to be aware of
41+
The `www-data` user has different IDs depending on your base operating system:
42+
- **Debian**: UID/GID `33:33`
43+
- **Alpine**: UID/GID `82:82`
44+
45+
::tip
46+
We kept these as the OS defaults to maintain compatibility with other tools and images. If you're mounting volumes from your host machine or switching between Debian and Alpine, you might need to adjust file permissions.
47+
::
48+
49+
### Running on standard HTTP/HTTPS ports (80 and 443)
50+
Don't worry—you have two easy options to run your app on the standard web ports:
3451

35-
Or you can simply use Docker's port mapping feature to map the container port to the host port. For example, to run the `fpm-nginx` variation on port 80 and 443, you can run the following command:
52+
#### Docker port mapping (recommended for development)
53+
Use Docker's built-in port mapping to route traffic from port 80/443 on your host to the container's higher ports:
3654

3755
```bash [Terminal]
3856
docker run -p 80:8080 -p 443:8443 serversideup/php:8.4-fpm-nginx
3957
```
4058

59+
This tells Docker: "Take traffic coming to port 80 on my machine and send it to port 8080 in the container."
60+
61+
#### Reverse proxy (recommended for production)
62+
Use a reverse proxy like [Caddy](https://caddyserver.com/){target="_blank"}, [Traefik](https://traefik.io/){target="_blank"}, or [NGINX](https://nginx.org/){target="_blank"} to handle SSL certificates and route traffic to your containers. This is the preferred approach for production because it:
63+
- Automatically handles SSL certificate generation and renewal
64+
- Can route to multiple containers/services
65+
- Provides additional security features like rate limiting
66+
67+
:u-button{to="/docs/deployment-and-production/configuring-ssl" label="Learn about SSL configuration" aria-label="Learn about SSL configuration" size="md" color="primary" variant="outline" trailing-icon="i-lucide-arrow-right" class="font-bold ring ring-inset ring-blue-600 text-blue-600 hover:ring-blue-500 hover:text-blue-500"}
68+
4169
## Default Environment Variables
4270
Environment variables give you a ton of flexibility to customize your container without the complexity of mounting custom configuration files. By default, these images are set to production-ready values. You can read more about the available environment variables below.
4371

0 commit comments

Comments
 (0)