1. Caddy version (caddy version
):
v2.1.1 h1:X9k1+ehZPYYRSqBvf/ocUgdLSRIuiNiMo7CvyGUQKeA=
2. How I run Caddy:
a. System environment:
Running in Docker.
b. Command:
Nothing fancy. A simple docker-compose up
c. Service/unit/compose file:
Here is my complete docker-compose.yml
version: '3'
services:
caddy:
image: caddy
cap_add:
- CAP_NET_BIND_SERVICE
ports:
- 80:80
- 443:443
volumes:
- ./Caddyfile:/etc/Caddyfile
- ./config:/config
- ./data:/data
d. My complete Caddyfile or JSON config:
Here is my complete Caddyfile
mydomain.com
tls myemail@mydomain.com
3. The problem I’m having:
The log says that the “server is listening only on the HTTP port, so no dynamic HTTPS will be applied to this server”
4. Error messages and/or full log output:
Attaching to caddy_caddy_1
caddy_1 | {"level":"info","ts":1597710814.1092606,"msg":"using provided configuration","config_file":"/etc/caddy/Caddyfile","config_adapter":"caddyfile"}
caddy_1 | {"level":"info","ts":1597710814.1145465,"logger":"admin","msg":"admin endpoint started","address":"tcp/localhost:2019","enforce_origin":false,"origins":["[::1]:2019","127.0.0.1:2019","localhost:2019"]}
caddy_1 | {"level":"info","ts":1597710814.1154902,"logger":"http","msg":"server is listening only on the HTTP port, so no automatic HTTPS will be applied to this server","server_name":"srv0","http_port":80}
caddy_1 | {"level":"info","ts":1597710814.116081,"logger":"tls","msg":"cleaned up storage units"}
caddy_1 | {"level":"info","ts":1597710814.116735,"msg":"autosaved config","file":"/config/caddy/autosave.json"}
caddy_1 | {"level":"info","ts":1597710814.1171699,"msg":"serving initial configuration"}
caddy_1 | 2020/08/18 00:33:34 [INFO][cache:0xc000487800] Started certificate maintenance routine
5. What I already tried:
The same Caddyfile
works well in a Caddy v1 based container. Going through the docs, this is supposed to work; but for the life of me, cannot figure out where I’m going wrong