1. Caddy version (caddy version
):
Caddy 2.1 Docker with DNS challenge namecheap
2. How I run Caddy:
Here is my Dockerfile:
||FROM caddy:builder AS builder|
| --- | --- |
|||
||RUN caddy-builder \|
||github.com/caddy-dns/lego-deprecated|
|||
||FROM caddy:latest|
|||
||COPY --from=builder /usr/bin/caddy /usr/bin/caddy|
environment:
Docker as per above dockerfile and compose etc.
I suspect I may not need the ports?
b. Command:
docker-compose up caddy2
c. Service/unit/compose file:
Here is my docker-compose
version: '3.8'
services:
caddy2:
container_name: caddy2
restart: unless-stopped
image: davidfw1960/caddy2-lego-deprecated
volumes:
- /home/docker/caddy2/caddy_config:/config
- /home/docker/caddy2/caddy_data:/data
- /home/docker/caddy2/Caddyfile:/usr/share/hassio/share/caddy
environment:
- PGID=1000
- PUID=1000
- TZ=Australia/Sydney
- NAMECHEAP_API_USER=xxxx
- NAMECHEAP_API_KEY=xxxx
ports:
- "80:80"
- "443:443"
d. My complete Caddyfile or JSON config:
Here is my Caddyfile
{ email david@wilfam.net
}
rebuild2.win:30443 {
tls {
dns lego_deprecated namecheap
}
header / {
Strict-Transport-Security "max-age=31536000; includeSubdomains"
X-XSS-Protection "1; mode=block"
X-Content-Type-Options "nosniff"
X-Frame-Options "SAMEORIGIN"
Referrer-Policy "same-origin"
-Server
}
reverse_proxy / localhost:8123 {
}
}
proxmox.rebuild2.win:30443 {
tls {
dns lego_deprecated namecheap
}
header / {
Strict-Transport-Security "max-age=31536000; includeSubdomains"
X-XSS-Protection "1; mode=block"
X-Content-Type-Options "nosniff"
X-Frame-Options "SAMEORIGIN"
Referrer-Policy "same-origin"
-Server
}
reverse_proxy / 10.90.11.150:8006 {
}
}
### 3. The problem I'm having:
<!-- What are you trying to do, and what isn't working? Please describe the issue thoroughly enough so that anyone can reproduce the exact behavior you're seeing. Be as specific as possible. -->
It just hangs. It's not trying to get certificates
### 4. Error messages and/or full log output:
<!-- Please **DO NOT REDACT** any information except credentials. -->
david@debian-pm:~$ docker-compose up caddy2
Creating caddy2 … done
Attaching to caddy2
caddy2 | {“level”:“info”,“ts”:1593232838.3610024,“msg”:“using provided configuration”,“config_file”:"/etc/caddy/Caddyfile",“config_adapter”:“caddyfile”}
caddy2 | {“level”:“info”,“ts”:1593232838.362422,“logger”:“admin”,“msg”:“admin endpoint started”,“address”:“tcp/localhost:2019”,“enforce_origin”:false,“origins”:[“localhost:2019”,"[::1]:2019",“127.0.0.1:2019”]}
caddy2 | {“level”:“info”,“ts”:1593232838.3631501,“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}
caddy2 | {“level”:“info”,“ts”:1593232838.3634052,“logger”:“tls”,“msg”:“cleaned up storage units”}
caddy2 | 2020/06/27 04:40:38 [INFO][cache:0xc00083c460] Started certificate maintenance routine
caddy2 | {“level”:“info”,“ts”:1593232838.364195,“msg”:“autosaved config”,“file”:"/config/caddy/autosave.json"}
caddy2 | {“level”:“info”,“ts”:1593232838.364431,“msg”:“serving initial configuration”}
### 5. What I already tried:
<!-- Show us what effort you've put in to solving the problem. Be specific -- people are volunteering their time to help you! Low effort posts are not likely to get good answers! -->
### 6. Links to relevant resources:
The caddy container is actually being created. But no certs so I can't access it.....