Skip to content

docs: migrate.md adjust volume mount path#2337

Open
francislavoie wants to merge 3 commits intophp:mainfrom
francislavoie:patch-1
Open

docs: migrate.md adjust volume mount path#2337
francislavoie wants to merge 3 commits intophp:mainfrom
francislavoie:patch-1

Conversation

@francislavoie
Copy link
Copy Markdown
Contributor

The rest of the examples use /var/www/app, so the volume mount should match.

Signed-off-by: Francis Lavoie <lavofr@gmail.com>
@henderkes
Copy link
Copy Markdown
Contributor

Oh, great catch, but the image defaults to /app. We'll need to adjust all other occurrences instead :/

henderkes pushed a commit to henderkes/frankenphp that referenced this pull request Apr 10, 2026
The FrankenPHP Docker image defaults to /app, so update all Caddyfile
examples to use /app/public instead of /var/www/app/public. The "Before"
(Nginx/PHP-FPM) examples retain /var/www/app as that reflects a typical
legacy setup.

Ref: php#2337

https://claude.ai/code/session_01DE6NMaJLcHC5nnQNwwAmCc
@henderkes
Copy link
Copy Markdown
Contributor

Meh, Claude isn't getting it right. I'll just do it...

Copy link
Copy Markdown
Contributor

@henderkes henderkes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default path isn't /var/www/app for the nginx image either, so it's fine just overwriting the config for our example like we do in the nginx one.

docs/migrate.md Outdated
volumes:
- .:/app/public
- .:/var/www/app
- ./Caddyfile:/etc/frankenphp/Caddyfile
Copy link
Copy Markdown
Contributor Author

@francislavoie francislavoie Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally we recommend mounting a directory rather than a file because certain methods of editing files don't correctly get followed by a bind mount (if the inode swaps or w/e, I think).

So it should be more like this:

Suggested change
- ./Caddyfile:/etc/frankenphp/Caddyfile
- ./config:/etc/frankenphp

Where the Caddyfile is at ./config/Caddyfile.

Also this lets users have more config files that get imported in chunks.

Covered here https://caddyserver.com/docs/running#docker-compose

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason why I added this is for parity with the nginx example above, so when the nginx example mounts in the single file, the frankenphp example should, too. Or we change it for both. This is really for a minimal configuration where multiple files aren't needed (typically the app-level Caddyfile is meant to run standalone, isolated, anyhow).

Copy link
Copy Markdown
Contributor Author

@francislavoie francislavoie Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get that, but it's a well-known footgun where if you edit the Caddyfile with vim then try to reload it will not work if you mounted it this way. (Works fine if you used nano, it saves the file with the same inode)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's change it for both then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants