Skip to content
/ caddy Public

caddy webserver optimized for usage within the SIWECOS project

License

Notifications You must be signed in to change notification settings

SIWECOS/caddy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

caddy

MicroBadger Size Docker Pulls Main Project

A Docker image for Caddy. This image includes cors, ipfilter, realip, expires and cache plugins.

Plugins can be configured via the plugins build arg.

Check abiosoft/caddy:builder for generating cross-platform Caddy binaries.

License

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.

Thanks to the original author @abiosoft for providing the abiosoft/caddy-docker repository!

Let's Encrypt Subscriber Agreement

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.

Getting Started

$ docker run -d -p 2015:2015 siwecos/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!

Saving Certificates

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

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 \
    abiosoft/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!

Usage

Paths in container

Caddyfile: /etc/Caddyfile

Sites root: /srv

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]

Credits

Thanks to the original author @abiosoft for providing the abiosoft/caddy-docker repository!

Thanks to @mholt and the caddy community for creating Caddy

About

caddy webserver optimized for usage within the SIWECOS project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published