Update README.md

This commit is contained in:
Teddysun 2020-09-20 14:52:11 +09:00
parent a50ce6de86
commit 6d9b1ee4bb
No known key found for this signature in database
GPG Key ID: 09BD4C080AD6C46D

View File

@ -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/