Sign inSign up

kirushik/caddy-docker

By kirushik

•Updated about 8 years ago

A Docker image for Caddy. Based on https://github.com/abiosoft/caddy-docker, which is awesome!

Image
0

281

kirushik/caddy-docker repository overview

⁠caddy

A Docker⁠ image for Caddy⁠. Based on https://github.com/abiosoft/caddy-docker⁠, which is awesome!

Please note that this downloads binary builds of caddy, which are free only for personal use!

⁠Getting Started

$ docker run -d -p 2015:2015 kirushik/caddy

Point your browser to http://127.0.0.1:2015.

⁠Run the image
$ docker run -d -v $(pwd)/Caddyfile:/etc/Caddyfile -p 2015:2015 abiosoft/caddy

Point your browser to http://127.0.0.1:2015.

⁠Usage

⁠Default Caddyfile

The image contains a default Caddyfile.

0.0.0.0
browse
⁠Paths in container

Caddyfile: /etc/Caddyfile

Sites root: /srv

⁠Using local Caddyfile and sites root

Replace /path/to/Caddyfile and /path/to/sites/root accordingly.

$ docker run -d \
    -v /path/to/sites/root:/srv \
    -v path/to/Caddyfile:/etc/Caddyfile \
    -p 2015:2015 \
    abiosoft/caddy
⁠Let's Encrypt Auto SSL

Note that this does not work on local environments.

Use a valid domain and add email to your Caddyfile to avoid prompt at runtime. Replace mydomain.com with your domain and [email protected] with your email.

mydomain.com
tls [email protected]
⁠Run the image

You can change the the ports if ports 80 and 443 are not available on host. e.g. 81:80, 444:443

$ docker run -d \
    -v $(pwd)/Caddyfile:/etc/Caddyfile \
    -p 80:80 -p 443:443 \
    abiosoft/caddy

Optional but advised. Save certificates on host machine to prevent regeneration every time container starts. Let's Encrypt has rate limit⁠.

$ docker run -d \
    -v $(pwd)/Caddyfile:/etc/Caddyfile \
    -v $HOME/.caddy:/root/.caddy \
    -p 80:80 -p 443:443 \
    abiosoft/caddy

Tag summary

Content type

Image

Digest

Size

18 MB

Last updated

about 8 years ago

docker pull kirushik/caddy-docker