1. My Caddy version (caddy version
):
Caddy 2.0.0 (docker official image
2. How I run Caddy:
I followed the documentation
a. System environment:
docker under proxmox
b. Command:
$ docker run -d -p 80:80 -p 443:443
-v /site:/usr/share/caddy
-v caddy_data:/data
-v caddy_config:/config
caddy caddy file-server --domain mydomainDOTcom
c. Service/unit/compose file:
N/A
d. My complete Caddyfile or JSON config:
mydomainDOTcom
respond “Hello, world!”
3. The problem I’m having:
I am trying to install caddy 2 on docker
I set up caddy with this part of the documentation : Automatic TLS with the Caddy image
After running it when I type mydomainDOTcom on a web browser, https is correctly working.
I wanted to edit the Caddyfile as state on the doc. But in the docker command on the automatic TLS with caddy image, the path of the Caddyfile is not detailed.
I have tried to create it under /site:/usr/share/caddy, but it was not working (hello world was not displayed)
4. Error messages and/or full log output:
{“level”:“info”,“ts”:1588643323.458765,“logger”:“http”,“msg”:“server is listening only on the HTTPS port but has no TLS connection policies; adding one to enable TLS”,“server_name”:“static”,“https_port”:443}
{“level”:“info”,“ts”:1588643323.4587939,“logger”:“http”,“msg”:“enabling automatic HTTP->HTTPS redirects”,“server_name”:“static”}
{“level”:“info”,“ts”:1588643323.4594855,“logger”:“tls”,“msg”:“cleaned up storage units”}
{“level”:“info”,“ts”:1588643323.4599004,“logger”:“http”,“msg”:“enabling automatic TLS certificate management”,“domains”:[“mydomainDOTcom”]}
2020/05/05 01:48:43 [INFO][cache:0xc0003f8730] Started certificate maintenance routine
{“level”:“info”,“ts”:1588643323.6331892,“msg”:“autosaved config”,“file”:"/config/caddy/autosave.json"}
2020/05/05 01:48:43 Caddy 2 serving static files on :443
5. What I already tried:
Then I tried this
$ docker run -d -p 80:80 -p 443:443
-v /site:/usr/share/caddy
-v caddy_data:/data
-v caddy_config:/config
-v path to a folder/Caddyfile:/etc/caddy/Caddyfile
caddy caddy file-server --domain mydomainDOTcom
The Caddyfile with this inside :
mydomainDOTcom
respond “Hello, world!”
When I enter mydomainDOTcom, https is displayed but no hello world.
Question
Where do I need to put this Caddyfile under docker ? What are the permission of this file ? I have https working but caddy cannot access to the hello world of this Caddyfile.
Thank you