Skip to content

Commit aabbbc0

Browse files
committed
docs: drop redundant Caddyfile/Dockerfile filename comments
Per review feedback, a bare `# Caddyfile` or `# Dockerfile` on the first line of a `caddyfile` or `dockerfile` fenced block restates information the language tag already carries and just adds noise. Remove those generic headers and keep only the comments that name a specific file (e.g. `# compose.yaml`, `# static-build.Dockerfile`, `// public/index.php`) or describe the block's purpose.
1 parent e0b3d68 commit aabbbc0

6 files changed

Lines changed: 0 additions & 31 deletions

File tree

docs/config.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ You can specify a custom path with the `-c` or `--config` option.
1414
A minimal `Caddyfile` to serve a PHP application is shown below:
1515

1616
```caddyfile
17-
# Caddyfile
1817
# The hostname to respond to
1918
localhost
2019
@@ -45,7 +44,6 @@ PHP:
4544
- You should copy an official template provided by the PHP project:
4645

4746
```dockerfile
48-
# Dockerfile
4947
FROM dunglas/frankenphp
5048

5149
# Production:
@@ -87,7 +85,6 @@ The `php_server` or the `php` [HTTP directives](https://caddyserver.com/docs/cad
8785
Minimal example:
8886

8987
```caddyfile
90-
# Caddyfile
9188
localhost {
9289
# Enable compression (optional)
9390
encode zstd br gzip
@@ -99,7 +96,6 @@ localhost {
9996
You can also explicitly configure FrankenPHP using the [global option](https://caddyserver.com/docs/caddyfile/concepts#global-options) `frankenphp`:
10097

10198
```caddyfile
102-
# Caddyfile
10399
{
104100
frankenphp {
105101
num_threads <num_threads> # Sets the number of PHP threads to start. Default: 2x the number of available CPUs.
@@ -125,7 +121,6 @@ You can also explicitly configure FrankenPHP using the [global option](https://c
125121
Alternatively, you may use the one-line short form of the `worker` option:
126122

127123
```caddyfile
128-
# Caddyfile
129124
{
130125
frankenphp {
131126
worker <file> <num>
@@ -138,7 +133,6 @@ Alternatively, you may use the one-line short form of the `worker` option:
138133
You can also define multiple workers if you serve multiple apps on the same server:
139134

140135
```caddyfile
141-
# Caddyfile
142136
app.example.com {
143137
root /path/to/app/public
144138
php_server {
@@ -166,7 +160,6 @@ it's a PHP file or not. Read more about it in the [performance page](performance
166160
Using the `php_server` directive is equivalent to this configuration:
167161

168162
```caddyfile
169-
# Caddyfile
170163
route {
171164
# Add trailing slash for directory requests
172165
@canonicalPath {
@@ -190,7 +183,6 @@ route {
190183
The `php_server` and the `php` directives have the following options:
191184

192185
```caddyfile
193-
# Caddyfile
194186
php_server [<matcher>] {
195187
root <directory> # Sets the root folder to the site. Default: `root` directive.
196188
split_path <delim...> # Sets the substrings for splitting the URI into two parts. The first matching substring will be used to split the "path info" from the path. The first piece is suffixed with the matching substring and will be assumed as the actual resource (CGI script) name. The second piece will be set to PATH_INFO for the script to use. Default: `.php`
@@ -218,7 +210,6 @@ Workers can instead be restarted on file changes via the `watch` directive.
218210
This is useful for development environments.
219211

220212
```caddyfile
221-
# Caddyfile
222213
{
223214
frankenphp {
224215
worker {
@@ -237,7 +228,6 @@ where the FrankenPHP process was started. You can instead also specify one or mo
237228
[shell filename pattern](https://pkg.go.dev/path/filepath#Match):
238229

239230
```caddyfile
240-
# Caddyfile
241231
{
242232
frankenphp {
243233
worker {
@@ -269,7 +259,6 @@ The following example will always serve a file in the public directory if presen
269259
and otherwise forward the request to the worker matching the path pattern.
270260

271261
```caddyfile
272-
# Caddyfile
273262
{
274263
frankenphp {
275264
php_server {
@@ -294,7 +283,6 @@ But when the fix depends on a third party you don't control,
294283
`max_requests` provides a pragmatic and hopefully temporary workaround for production:
295284

296285
```caddyfile
297-
# Caddyfile
298286
{
299287
frankenphp {
300288
max_requests 500
@@ -324,7 +312,6 @@ When set, PHP will load all the file with the `.ini` extension present in the gi
324312
You can also change the PHP configuration using the `php_ini` directive in the `Caddyfile`:
325313

326314
```caddyfile
327-
# Caddyfile
328315
{
329316
frankenphp {
330317
php_ini memory_limit 256M
@@ -356,7 +343,6 @@ has been read. (for example: [Mercure](mercure.md), WebSocket, Server-Sent Event
356343
This is an opt-in configuration that needs to be added to the global options in the `Caddyfile`:
357344

358345
```caddyfile
359-
# Caddyfile
360346
{
361347
servers {
362348
enable_full_duplex

docs/docker.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ The tags follow this pattern: `dunglas/frankenphp:<frankenphp-version>-php<php-v
2323
Create a `Dockerfile` in your project:
2424

2525
```dockerfile
26-
# Dockerfile
2726
FROM dunglas/frankenphp
2827

2928
COPY . /app/public
@@ -47,7 +46,6 @@ The [`docker-php-extension-installer`](https://github.com/mlocati/docker-php-ext
4746
Adding additional PHP extensions is straightforward:
4847

4948
```dockerfile
50-
# Dockerfile
5149
FROM dunglas/frankenphp
5250

5351
# add additional extensions here:
@@ -66,7 +64,6 @@ FrankenPHP is built on top of Caddy, and all [Caddy modules](https://caddyserver
6664
The easiest way to install custom Caddy modules is to use [xcaddy](https://github.com/caddyserver/xcaddy):
6765

6866
```dockerfile
69-
# Dockerfile
7067
FROM dunglas/frankenphp:builder AS builder
7168

7269
# Copy xcaddy in the builder image
@@ -107,7 +104,6 @@ The `builder` image provided by FrankenPHP contains a compiled version of `libph
107104
Set the `FRANKENPHP_CONFIG` environment variable to start FrankenPHP with a worker script:
108105

109106
```dockerfile
110-
# Dockerfile
111107
FROM dunglas/frankenphp
112108

113109
# ...
@@ -163,7 +159,6 @@ FrankenPHP can run as non-root user in Docker.
163159
Here is a sample `Dockerfile` doing this:
164160

165161
```dockerfile
166-
# Dockerfile
167162
FROM dunglas/frankenphp
168163
169164
ARG USER=appuser
@@ -189,7 +184,6 @@ If you expose FrankenPHP on a non-privileged port (1024 and above), it's possibl
189184
the webserver as a non-root user, and without the need for any capability:
190185

191186
```dockerfile
192-
# Dockerfile
193187
FROM dunglas/frankenphp
194188
195189
ARG USER=appuser
@@ -229,7 +223,6 @@ To further reduce the attack surface and size of your FrankenPHP Docker images,
229223
When adding additional PHP extensions, you will need an intermediate build stage:
230224

231225
```dockerfile
232-
# Dockerfile
233226
FROM dunglas/frankenphp AS builder
234227
235228
# Add additional PHP extensions here

docs/migrate.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ server {
4646
Becomes a single `Caddyfile`:
4747

4848
```caddyfile
49-
# Caddyfile
5049
example.com {
5150
root /var/www/app/public
5251
php_server
@@ -62,7 +61,6 @@ Your existing `php.ini` works as-is. See [Configuration](config.md) for where to
6261
You can also set directives directly in the `Caddyfile`:
6362

6463
```caddyfile
65-
# Caddyfile
6664
{
6765
frankenphp {
6866
php_ini memory_limit 256M
@@ -82,7 +80,6 @@ In PHP-FPM, you tune `pm.max_children` to control the number of worker processes
8280
In FrankenPHP, the equivalent is `num_threads`:
8381

8482
```caddyfile
85-
# Caddyfile
8683
{
8784
frankenphp {
8885
num_threads 16
@@ -93,7 +90,6 @@ In FrankenPHP, the equivalent is `num_threads`:
9390
By default, FrankenPHP starts 2 threads per CPU. For dynamic scaling similar to PHP-FPM's `pm = dynamic`:
9491

9592
```caddyfile
96-
# Caddyfile
9793
{
9894
frankenphp {
9995
num_threads 4
@@ -161,7 +157,6 @@ In [classic mode](classic.md), FrankenPHP works like PHP-FPM: each request boots
161157
For better performance, you can switch to [worker mode](worker.md), which boots your application once and keeps it in memory:
162158
163159
```caddyfile
164-
# Caddyfile
165160
example.com {
166161
root /var/www/app/public
167162
php_server {

docs/production.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ If you're using API Platform (which also uses FrankenPHP), refer to [the deploym
1616
First, create a `Dockerfile` in the root directory of your PHP project:
1717

1818
```dockerfile
19-
# Dockerfile
2019
FROM dunglas/frankenphp
2120

2221
# Be sure to replace "your-domain-name.example.com" by your domain name
@@ -151,7 +150,6 @@ you must configure the [`trusted_proxies` global option](https://caddyserver.com
151150
so that Caddy trusts incoming `X-Forwarded-*` headers:
152151

153152
```caddyfile
154-
# Caddyfile
155153
{
156154
servers {
157155
trusted_proxies static <your-IPs>

docs/symfony.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ Hot reloading is enabled by default in [Symfony Docker](https://github.com/dungl
7171
To use the [hot reload](hot-reload.md) feature without Symfony Docker, enable [Mercure](mercure.md) and add the `hot_reload` sub-directive to the `php_server` directive in your `Caddyfile`:
7272

7373
```caddyfile
74-
# Caddyfile
7574
localhost
7675
7776
mercure {

docs/wordpress.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ Run [WordPress](https://wordpress.org/) with FrankenPHP to enjoy a modern, high-
2323
For a production-ready setup, prefer using `frankenphp run` with a `Caddyfile` like this one:
2424

2525
```caddyfile
26-
# Caddyfile
2726
example.com
2827
2928
php_server
@@ -36,7 +35,6 @@ log
3635
To use the [hot reload](hot-reload.md) feature with WordPress, enable [Mercure](mercure.md) and add the `hot_reload` sub-directive to the `php_server` directive in your `Caddyfile`:
3736

3837
```caddyfile
39-
# Caddyfile
4038
localhost
4139
4240
mercure {

0 commit comments

Comments
 (0)