A tiny 9MB Caddy image compressed with UPX. This includes http.cache, http.cgi, http.jwt, http.login, and http.realip plugins.
This image is built from source code. As such, it is subject to the project's Apache 2.0 license, but it neither contains nor is subject to the EULA for Caddy's official binary distributions.
Caddy may prompt to agree to Let's Encrypt Subscriber Agreement. This is configurable with ACME_AGREE environment variable. Set it to true to agree. ACME_AGREE=true.
Starting from v0.11.0, Telemetry stats are submitted to Caddy by default. To use Caddy without telemetry, use the :no-stats or :<version>-no-stats tags. e.g. :0.11.0-no-stats, :0.11.0-php-no-stats.
$ docker run -d -p 2015:2015 dishcleaner/caddy
Point your browser to http://127.0.0.1:2015.
Be aware! If you don't bind mount the location certificates are saved to, you may hit Let's Encrypt rate limits rending further certificate generation or renewal disallowed (for a fixed period)! See "Saving Certificates" below!
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 \
dishcleaner/caddy
Here, /root/.caddy is the location inside the container where caddy will save certificates.
Additionally, you can use an environment variable to define the exact location caddy should save generated certificates:
$ docker run -d \
-e "CADDYPATH=/etc/caddycerts" \
-v $HOME/.caddy:/etc/caddycerts \
-p 80:80 -p 443:443 \
dishcleaner/caddy
Above, we utilize the CADDYPATH environment variable to define a different location inside the container for
certificates to be stored. This is probably the safest option as it ensures any future docker image changes don't interfere with your ability to save certificates!
The image contains a default Caddyfile.
0.0.0.0
browse
fastcgi / 127.0.0.1:9000 php # php variant only
on startup php-fpm7 # php variant only
The last 2 lines are only present in the php variant.
Caddyfile: /etc/Caddyfile
Sites root: /srv
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 \
dishcleaner/caddy
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]
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 \
dishcleaner/caddy
Content type
Image
Digest
Size
8.8 MB
Last updated
over 4 years ago
docker pull dishcleaner/caddy