Caddy built with plugins from source in docker.
437
Run caddy in docker, build from source, add plugin from source. Agree to Let's Encrypt Subscriber Agreement by DEFAULT. Otherwise, modify the Dockerfile.
This image includes ipfilter, git, nobots, realip and caddy-docker-proxy plugins. Plugins can be configured via the plugin.go file in the repository.
$ docker run -d -p 2015:2015 dtcokr/caddy
Go to http://127.0.0.1:2015 to check if Caddy is running. If running remotely, go to http://remote_ip:2015.
Default certificates location /root/.caddy
$ docker run -d \
-v $PWD/Caddyfile:/etc/Caddyfile \
-v $HOME/.caddy:/root/.caddy \
-p 80:80 \
-p 443:443 \
dtcokr/caddy
Caddyfile: /etc/Caddyfile
Sites root: /www
$ docker run -d \
-v /path/to/Caddyfile:/etc/Caddyfile \
-v /path/to/sites/root:/www
-p 80:80 \
dtcokr/caddy
Add a vaild domain and email to your Caddyfile.
yourdomain.com
tls [email protected]
Run:
$ docker run -d \
-v /path/to/Caddyfile:/etc/Caddyfile \
-v $HOME/.caddy:/root/.caddy \
-v /path/to/sites/root:/www \
-p 80:80 \
-p 443:443 \
dtcokr/caddy
See Caddy-docker-proxy(GitHub)
docker-compose.yml example:
use labels to generate Caddyfile
version: "3"
services:
caddy:
images: dtcokr/caddy
ports:
- "80:80"
- "443:443"
- "2015:2015"
networks:
- caddy
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
- "/www:/www"
restart: always
labels:
caddy: ":2015"
caddy.root: "/www"
networks:
caddy:
Content type
Image
Digest
Size
14.6 MB
Last updated
over 6 years ago
docker pull dtcokr/caddy