reverie89/caddy

By reverie89

Updated 12 days ago

Caddy v2 with Cloudflare

Image
Web servers
3

100K+

reverie89/caddy repository overview

GitHub: https://github.com/reverie89/caddy

This is an automated build for reverie89/caddy.

Checks daily for updates to the caddy Docker image.

Overview for Caddy v2

Based on official image, then added: caddy-dns/cloudflare module

Usage example

docker-compose.yaml

services:
 caddy:
   image: reverie89/caddy
   container_name: caddy
   restart: always
   environment:
     - CLOUDFLARE_API_TOKEN=xxx
   ports:
     - "80:80/tcp"
     - "443:443/tcp"
   volumes:
     - "/etc/localtime:/etc/localtime:ro"
     - "./Caddyfile:/etc/caddy/Caddyfile"
     - "./config:/config"
     - "./data:/data"
     - "/var/www:/var/www"
How to use Caddyfile

Official docs

subdomain.example.com {
 tls {
   dns cloudflare {env.CLOUDFLARE_API_TOKEN}
 }
 reverse_proxy /* endpoint:80
}

example.com {
 tls {
   dns cloudflare {env.CLOUDFLARE_API_TOKEN}
 }
 root * /var/www/example.com
}

Take note

  • Caddy v2 requires Cloudflare API token. You will need to create a token if you don't have one.
  • Remember to volume mount /config and /data
  • Graceful Caddyfile reload: docker exec -w /etc/caddy {container_name} caddy reload
  • Format and overwrite Caddyfile: docker exec -w /etc/caddy {container_name} caddy fmt --overwrite

Tag summary

Content type

Image

Digest

sha256:d12824479

Size

39.2 MB

Last updated

12 days ago

docker pull reverie89/caddy:2.11.4