You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enhance FrankenPHP documentation with detailed sections on security-first design, health checks, production-grade configurations, and orchestrator deployments. Added information on environment variable consistency and support for multiple operating systems, emphasizing best practices for production environments.
Copy file name to clipboardExpand all lines: docs/content/docs/2.image-variations/frankenphp.md
+101-1Lines changed: 101 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,6 @@ Use the FrankenPHP variation when you need to:
45
45
FrankenPHP is the newest variation and represents the future of PHP application servers. If you're starting a new project and can commit to modern practices, this is the variation to choose.
Some people are reporting performance issues on the `alpine` version of FrankenPHP. If you're experiencing this, consider using the `debian` version.
@@ -55,6 +54,107 @@ FrankenPHP is cutting edge and is a very active project. Be sure to understand F
55
54
56
55
:u-button{to="https://frankenphp.dev/docs/known-issues/"target="_blank"label="View FrankenPHP's known issues"aria-label="FrankenPHP known issues"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"}
57
56
57
+
## Differences from Official FrankenPHP Images
58
+
59
+
Our FrankenPHP images are built with production deployments and enterprise security in mind. While the official FrankenPHP images are great for getting started, we've made several enhancements that make these images more suitable for production environments, especially when deploying at scale with orchestrators like Kubernetes, Docker Swarm, or managed container platforms.
60
+
61
+
### Security-First Design: Unprivileged by Default
62
+
63
+
Unlike the official FrankenPHP images that run as root, our images run as the unprivileged `www-data` user by default. This dramatically reduces your security footprint in production environments.
64
+
65
+
**What this means for you:**
66
+
- Containers run with minimal privileges, following security best practices
67
+
- HTTP listens on port `8080` (instead of 80)
68
+
- HTTPS listens on port `8443` (instead of 443)
69
+
- Consistent with our other image variations for a unified experience
70
+
71
+
::tip
72
+
This unprivileged design is consistent across all our image variations. Learn more about our [default configurations](/docs/getting-started/default-configurations#unprivileged-by-default).
73
+
::
74
+
75
+
### Native Health Checks with Laravel Integration
76
+
77
+
Health checks are critical for zero-downtime deployments, but the official images don't include them. Our images come with intelligent health check endpoints that work out of the box.
78
+
79
+
**Built-in features:**
80
+
- Default `/healthcheck` endpoint configured in Caddy
81
+
- Configurable via `HEALTHCHECK_PATH` environment variable
82
+
- Works with Laravel's native `/up` health check endpoint
83
+
- Ensures your application is truly ready before accepting traffic
84
+
85
+
```yml [compose.yml]
86
+
services:
87
+
php:
88
+
image: serversideup/php:8.4-frankenphp
89
+
environment:
90
+
# Use Laravel's built-in health check
91
+
HEALTHCHECK_PATH: /up
92
+
healthcheck:
93
+
test: ["CMD", "healthcheck"]
94
+
interval: 10s
95
+
timeout: 5s
96
+
retries: 3
97
+
```
98
+
99
+
::tip
100
+
Learn more about [using health checks with Laravel](/docs/guide/using-healthchecks-with-laravel) to ensure your application is ready before accepting requests.
101
+
::
102
+
103
+
### Production-Grade Caddyfile Configuration
104
+
105
+
The official FrankenPHP Dockerfile provides a basic Caddyfile to get started. We've spent considerable time crafting a production-ready configuration that includes security hardening, performance optimizations, and enterprise features.
106
+
107
+
**What's included:**
108
+
- **CloudFlare integration** - Trusted IP addresses configured automatically
109
+
- **Security headers** - Best-practice headers included by default
110
+
- **Performance rules** - Smart caching and compression configured
111
+
- **Flexible logging** - Configurable output formats and levels
112
+
- **Self-signed certificates** - Automatic generation for development environments
FrankenPHP's tight integration with Caddy enables amazing features like automatic Let's Encrypt SSL certificates. However, in most production deployments, you're likely using a load balancer or reverse proxy for SSL termination, making Caddy's automatic SSL less useful and potentially problematic at scale.
118
+
119
+
**Our orchestrator-first approach:**
120
+
- Assumes SSL/TLS termination happens at the load balancer level
121
+
- Optimized for zero-downtime rolling deployments
122
+
- Works seamlessly with Kubernetes, Docker Swarm, and managed platforms
123
+
- Simplifies scaling from one container to hundreds
You can still use Caddy's automatic HTTPS with Let's Encrypt if you prefer. See our [Configuring SSL](/docs/deployment-and-production/configuring-ssl) guide for all available options.
129
+
::
130
+
131
+
### Consistent Environment Variable Experience
132
+
133
+
Just like all our other PHP variations, the FrankenPHP images support the same environment variables and helper scripts you're already familiar with.
134
+
135
+
**Unified configuration across all variations:**
136
+
- `SSL_MODE` - Control SSL behavior (`off`, `mixed`, `full`)
137
+
- `LOG_OUTPUT_LEVEL`- Adjust logging verbosity
138
+
- PHP INI settings via environment variables
139
+
- Helper scripts for permissions management
140
+
- Consistent startup script behavior
141
+
142
+
This means you can switch between variations (FrankenPHP, FPM-NGINX, FPM-Apache) with minimal configuration changes.
143
+
144
+
:u-button{to="/docs/reference/environment-variable-specification" label="View all environment variables" aria-label="View environment variable specification" 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"}
145
+
146
+
### More Operating System Variations
147
+
148
+
We compile FrankenPHP from source, which allows us to support multiple operating systems for maximum flexibility.
149
+
150
+
**Available platforms:**
151
+
- Debian Bookworm (12)
152
+
- Debian Trixie (13)
153
+
- Alpine 3.21
154
+
- Alpine 3.22
155
+
156
+
This gives you the freedom to choose the base OS that best fits your infrastructure and security requirements.
0 commit comments