Small and simple container to Caddy web server. I mostly use it as reverse proxy and https endpoint. Container is based on official caddy binary downloaded from developer's site.
Please note: This container uses non-root user. However, in order to bind privileged ports (80 and 433) I've set capabilities (cap_net_bind_service) of caddy binary. If you are going to use this image to serve static you can simply mount /srv folder as your web root, add some folder to keep generated ACME certificates and specify the rest via command line, no config file is necessary:
docker run -d --restart unless-stopped \
--name caddy \
-e TZ='Europe/Moscow' -e UID=1001 -e GID=1001 \
-p 80:80 -p 443:443 -p 2015:2015 \
-v /home/media/caddy:/caddy \
-v /opt/nginx/html:/srv \
ppoloskov/caddy -email [email protected] -host mysite.com
The way I run it:
docker run -d --restart unless-stopped --network medianet \
--name caddy \
-e TZ='Europe/Moscow' -e UID=1001 -e GID=1001 \
-p 80:80 -p 443:443 -p 2015:2015 \
-v /home/media/caddy/Caddyfile:/etc/Caddyfile:ro \
-v /home/media/caddy:/caddy \
-v /home/media/nginx/html:/srv
ppoloskov/caddy -conf /etc/Caddyfile
Content type
Image
Digest
Size
13.6 MB
Last updated
about 7 years ago
docker pull ppoloskov/caddy