From 6d9b1ee4bbb0a5a4198f028dc36b50b40f25239d Mon Sep 17 00:00:00 2001 From: Teddysun Date: Sun, 20 Sep 2020 14:52:11 +0900 Subject: [PATCH] Update README.md --- docker/caddy/README.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docker/caddy/README.md b/docker/caddy/README.md index f5f3d93..df48a1d 100644 --- a/docker/caddy/README.md +++ b/docker/caddy/README.md @@ -28,14 +28,19 @@ You **must create a configuration file** `/etc/caddy/Caddyfile` in host at firs $ mkdir -p /etc/caddy ``` -A sample `Caddyfile` please visit [here](https://github.com/caddyserver/dist/blob/master/config/Caddyfile) +Mount your site root using the `www` volume, a sample `Caddyfile` like below: -Caddy requires write access to two locations: a [data directory](https://caddyserver.com/docs/conventions#data-directory), and a [configuration directory](https://caddyserver.com/docs/conventions#configuration-directory). +``` +:80 { + root /www + index index.html +} +``` There is an example to override the default `Caddyfile`, you can mount a new one at `/etc/caddy/Caddyfile` like below: ```bash -$ docker run -d -p 80:80 --name caddy --restart=always -v /etc/caddy:/etc/caddy teddysun/caddy +$ docker run -d -p 80:80 --name caddy --restart=always -v /etc/caddy:/etc/caddy -v $(pwd)/site:/www teddysun/caddy ``` [1]: https://caddyserver.com/