一键运行脚本:
curl -s https://files-cdn.cnblogs.com/files/nihaorz/start-caddy-file-server.sh | sh
代码如下:
#!/bin/bash mkdir -p /etc/caddy cat > /etc/caddy/Caddyfile << EOF :2015 { file_server { root /data hide .* browse } } EOF docker run -d \ -p 2015:2015 \ --restart always \ --name caddy \ -v /etc/caddy/Caddyfile:/etc/caddy/Caddyfile \ -v $PWD:/data \ caddy
标签:files,容器,caddy,etc,sh,服务器 From: https://www.cnblogs.com/nihaorz/p/17150782.html