1. My Caddy version (caddy version
):
GitHub - caddyserver/caddy-docker: Source for the official Caddy v2 Docker Image (v2.0.0-rc.2)
2. How I run Caddy:
Docker
a. System environment:
Docker
b. Command:
docker run -d -p 32080:80 -p 32443:443 \
--name caddy2 \
-e "CADDYPATH=/etc/caddycerts" \
-v $(pwd)/docker_data/caddy/Caddyfile:/etc/caddy/Caddyfile \
-v $HOME/docker_data/caddy/mySite/:/etc/caddy/mySite/ \
-v $HOME/docker_data/caddy/data/:/data \
-v $HOME/docker_data/caddy/config/:/config \
-v $HOME/docker_data/caddy/.caddy:/etc/caddycerts \
caddy/caddy caddy file-server
c. Service/unit/compose file:
I don't even know what this is
d. My complete Caddyfile or JSON config:
localhost:443
root * /etc/caddy/mySite
try_files {path} /index.html
file_server
3. The problem I’m having:
Caddy simply does not appear to be serving my site. When I start the container and navigate to localhost:32080 and/or localhost:32443, I cannot load the site. I am simply looking for a working caddyfile and docker install command to get me up and running with a very basic website. The website is a simple index.html file and 4 javascript files in a folder. This is a site that is currently available publicly (hosted on another server). I want to test this locally first, and then serve it publicly.
4. Error messages and/or full log output:
Docker logs after installing using above info:
{“level”:“warn”,“ts”:1586608004.591889,“logger”:“admin”,“msg”:“admin endpoint disabled”}
{“level”:“info”,“ts”:1586608004.5956352,“logger”:“http”,“msg”:“server is listening only on the HTTP port, so no automatic HTTPS will be applied to this server”,“server_name”:“static”,“http_port”:80}
{“level”:“info”,“ts”:1586608004.5980573,“logger”:“tls”,“msg”:“cleaned up storage units”}
{“level”:“info”,“ts”:1586608004.600832,“msg”:“autosaved config”,“file”:"/config/caddy/autosave.json"}
2020/04/11 12:26:44 Caddy 2 serving static files on :80
2020/04/11 12:26:44 [INFO][cache:0xc00046e730] Started certificate maintenance routine
5. What I already tried:
I’ve tried a few different ports, and a few different install scripts. I honestly wish I could remember. This is not a failure of the software - I simply cannot find an idiot-proof guide for docker installation for my scenario.