This is a Docker image for using Caddy as a reverse proxy for Docker containers, allowing you to easily expose multiple services on one or many domain names with automatic HTTPS encryption using Cloudflare.
The image is based on the official Caddy Docker image and includes the following plugins
I have a Raspberry pi running docker with many services and I want a clean way to get a https reverse proxy up and running without opening port 80 to the world.
Create a docker-compose.yml
file with the following content:
version: "3.3"
networks:
frontend:
name: frontend
services:
# Caddy set up
caddy:
image: jcdcdev/caddy-docker-proxy-cloudflare:latest
ports:
- 80:80
- 443:443
networks:
- frontend
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- '~/caddy/data:/data'
labels:
caddy: (cftls)
caddy.tls.dns: cloudflare "API-KEY-HERE"
caddy.tls.resolvers: 1.1.1.1
# Container that uses Caddy
who:
image: traefik/whoami
networks:
- frontend
labels:
caddy: who-am-i.my-domain.com
caddy.reverse_proxy: "{{upstreams 80}}"
caddy.import: cftls
Contributions to this image are most welcome! Please read the Contributing Guidelines.
- lucaslorentz - caddy-docker-proxy
- caddy-dns - caddy-dns/cloudflare