Kubernetes/Docker/Docs/Docker使用Caddy.md
offends 7a2f41e7d6
All checks were successful
continuous-integration/drone Build is passing
synchronization
2024-08-07 18:54:39 +08:00

510 B

本文作者:丁辉

Docker使用Caddy

官网

  1. 启动 Caddy 容器

    docker run -itd \
      --restart always \
      -p 80:80 \
      -v $PWD/data/caddy:/etc/caddy/ \
      --name=caddy \
      caddy:latest
    
  2. 进入容器修改配置文件

    vi /etc/caddy/Caddyfile
    

    内容如下

    :80 {
    	root * /etc/caddy/www
    	file_server
    }
    
  3. 重启容器

    docker restart caddy
    
  4. 访问 IP:80