Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
99 lines (75 sloc) 3.07 KB

caddy

dockerhub-pulls-badge

A Docker image for Caddy. This image includes cross-platform support, as well as the following Caddy plugins:

Getting Started

For complete documentation, check out the Caddy website or e.g., the caddy-docker repo.

To get started, run the following, and point your browser to http://127.0.0.1:2015.

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

Let's Encrypt Subscriber Agreement

Caddy may prompt you to agree to Let's Encrypt Subscriber Agreement. This is configurable with ACME_AGREE environment variable.

Default Caddyfile

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.

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 \
    jessestuart/caddy

Let's Encrypt Auto SSL

Use a valid domain and add email to your Caddyfile to avoid prompt at runtime. Replace mydomain.com with your domain and user@host.com with your email.

Note that this does not work on local environments.

mydomain.com
tls user@host.com
You can’t perform that action at this time.