Public | Automated Build

Last pushed: 8 months ago
Short Description
Caddy server Docker Image
Full Description

Caddy server with addons

alpine:edge based docker image for caddy server. Includes all the caddy addons.

Usage

Using default Caddyfile

$ docker run -d \
    -p 80:80 \
    -v ${PWD}/public:/var/www/html \
    --name 'caddy' \
    vanthiyathevan/caddy-server

To use with your own Caddyfile

$ docker run -d \
    -p 80:80 \
    -v ${PWD}/public:/var/www/html \
    -v ${PWD}/Caddyfile:/etc/Caddyfile \
    --name 'caddy' \
    vanthiyathevan/caddy-server

With tls directive, you can tell caddy to generate automatic SSL certificates from Let's Encrypt. Caddy by default store the certificate to /root/.caddy inside the container. To persist the certificates,

# Create docker volume to persist the certs
$ docker volume create --name caddy-certs

$ docker run -d \
    -p 80:80 \
    -p 443:443 \
    -v ${PWD}/public:/var/www/html \
    -v ${PWD}/Caddyfile:/etc/Caddyfile \
    -v caddy-certs:/root/.caddy \
    --name 'caddy' \
    vanthiyathevan/caddy-server

Inspired by

ZZROTDesign/alpine-caddy

Docker Pull Command
Owner
vanthiyathevan
Source Repository