快速 不破坏宿主机环境
只需一个docker容器 容易维护
兼容trojan ,naiveproxy两个协议
自动申请证书
安装docker
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
或者参考:
创建Caddyfile
cd
mkdir -p ~/docker/caddy
vi ~/docker/caddy/Caddyfile
Caddyfile
You need to
Reply and refresh to see the content
docker network create web
创建 /启动容器:
docker run -d \
--name=caddy \
--network=web \
-p 443:443/tcp \
-p 443:443/udp \
-v $HOME/docker/caddy/Caddyfile:/etc/caddy/Caddyfile \
-v $HOME/docker/caddy/data:/data \
--restart=unless-stopped \
tinyserve/caddy
docker-compose.yaml
version: '3.3'
services:
caddy:
container_name: caddy
network_mode: web
ports:
- '443:443/tcp'
- '443:443/udp'
volumes:
- '$HOME/docker/caddy/Caddyfile:/etc/caddy/Caddyfile'
- '$HOME/docker/caddy/data:/data'
restart: unless-stopped
image: tinyserve/caddy