Sign inSign up

dsuite/caddy

By dsuite

•Updated almost 5 years ago

Image
0

1.3K

dsuite/caddy repository overview

⁠ caddy

Build Status Docker Pulls Docker Stars MicroBadger Layers (tag) MicroBadger Size (tag) License: MIT

This is a docker image for Caddy⁠ server running on Alpine container⁠ with runit⁠ process supervisor.

⁠ Volumes

  • /etc/caddy
  • /etc/caddy/certificates
  • /var/www
  • /var/log

⁠ Ports

  • 80
  • 443
  • 2015

⁠ Available environment variables

NameDefault value
CADDY_AGREEfalse
CADDY_CAhttps://acme-v01.api.letsencrypt.org/directory
CADDY_CA_TIMEOUT10s
CADDY_CPU100%
CADDY_EMAIL[empty]
CADDY_GRACE5s
CADDY_HTTP2true
CADDY_QUIETfalse
CADDY_PORT2015
CADDY_HTTP_PORT80
CADDY_HTTPS_PORT443
PGID1050
PUID1050

⁠ How to use this image

docker build -t dsuite/caddy .
docker run -it -d --name=caddy \
        -p 2015:2015 \
        -v $(PWD)/path/to/Caddyfile:/etc/caddy/Caddyfile \
        -v $(PWD)/path/to/www:/var/www \
            dsuite/caddy:1.0

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

⁠Saving Certificates

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

docker run -it -d --name=caddy \
        -p 80:80 -p 443:443 \
        -v $(PWD)/path/to/certs:/etc/caddy/certificates \
        -v $(PWD)/path/to/Caddyfile:/etc/caddy/Caddyfile \
        -v $(PWD)/path/to/www:/var/www \
            dsuite/caddy:1.0

Here, /etc/caddy/certificates is the location inside the container where caddy will save certificates.

To start or stop caddy, get an sh command prompt inside the container:

docker exec -it caddy sh

# Start caddy
runit service caddy start
# Stop caddy
runit service caddy stop
# Restart caddy
runit service caddy restart
# Status of caddy
runit service caddy status

# Stop the container
runit stop

⁠ How to add plugins

dsuite/caddy comes with an installer which download and intall the latest version from caddyserver.com
Update the PLUGINS environment variable with a coma separated list of plugin and run caddy-install.sh to download and install the latest version of caddy with the desired plugins.

⁠with a docker file
FROM dsuite/caddy:latest

ENV PLUGINS="http.git"

⁠ An example

Have a look at the example folder⁠. You'll find out how to create an image based on dsuite/caddy

Tag summary

Content type

Image

Digest

Size

18.8 MB

Last updated

almost 5 years ago

docker pull dsuite/caddy