FYI, we recommend to put your static files in /srv or /var/www/html.
Since /srv is often used by Docker images (like /opt in distributions)
I believe /var/www/html was the webroot that the distributions adopted.
This will be a Docker environment to use together or a personal preference.
(In my case, I prefer to put it in /home unless I’m in a Docker environment, or in Dropbox)
I’m copying to /usr/share/caddy because that’s the default behavior
and I wanted to keep the Dockerfile as simple as possible.
Other web server Docker image is also in /usr, so this is common,
The PHP Docker image defaulted to /var/www/html.
I’m currently missing a Caddyfile in my GitHub project. It uses default settings.
The reason I originally put the Caddyfile in was that I needed to get the port number from the environment variable PORT.
However, even when I put sed in the Dockerfile, it didn’t seem to work.
That’s why I included the PORT in the Caddyfile.
You can set the environment variable PORT manually, but it can be set after deploying once, so you will see One Moment or Application Error once the first time. I needed to clear up that confusion of yours.
Railway is slow to boot if it is a trial. After the URL is displayed, it takes time to get a normal display. If you use these, you should wait patiently. I was getting trouble with it initially when I used Railway.
If so, shouldn’t the Basic Usage in the document be changed because it’s not a recommended usage? Because I’m posting non-recommended information from the past! (That’s when Caddy Docker was first released!)
However, since the topic is too different from the original post, please separate it and work on discussion etc. if necessary.