dunglas / frankenphp

🧟 The modern PHP app server
https://frankenphp.dev
MIT License
6.16k stars 193 forks source link

404 from Caddy when running the onenliner docker run command #771

Closed danwie closed 3 weeks ago

danwie commented 3 weeks ago

I'm a complete beginner in frankenphp. I want to try it out. I'm using Docker Desktop on macOS Sonoma 14.4.1.

When using the oneliner docker run -v $PWD:/app/public -p 443:443 dunglas/frankenphp. When accessing https://localhost I get 404 Not Found. When checking the response headers I can see that server is Caddy. I've also tried changing the port to 8443 but that didn't help. I have also added my own test.txt in the $PWD directory - but accessing https://localhost/test.txt also gives 404.

I'm unable to find the caddy error log so I'm not sure how to proceed. What have I done wrong?

dunglas commented 3 weeks ago

FrankenPHP is a custom build of Caddy with a built-in PHP module, so references to Caddy in the headers are normal.

Are you using a framework such as Laravel or Symfony? In this case, the document root is usually $PWD/public and you should use this command: docker run -v $PWD:/app 443:443 dunglas/frankenphp.

danwie commented 3 weeks ago

Thank you @dunglas. Now I got the phpinfo() page when accessing https://localhost