diff --git a/src/docs/markdown/running.md b/src/docs/markdown/running.md
index bc783a8..d42c602 100644
--- a/src/docs/markdown/running.md
+++ b/src/docs/markdown/running.md
@@ -14,6 +14,8 @@ While Caddy can be run directly with its [command line interface](/docs/command-
- [Overrides](#overrides)
- [Windows Service](#windows-service)
- [Docker Compose](#docker-compose)
+ - [Setup](#setup)
+ - [Usage](#usage)
## Linux Service
@@ -105,7 +107,9 @@ You can stop the service with:
sudo systemctl stop caddy
The Caddy process will run as the `caddy` user, which has its `$HOME` set to `/var/lib/caddy`. This means that:
@@ -223,12 +227,20 @@ For customizing the service wrapper, see the [WinSW documentation](https://githu
## Docker Compose
-The simplest way to get up and running with Docker is to use Docker Compose. _The below is only an excerpt. See the docs on [Docker Hub](https://hub.docker.com/_/caddy) for more details_.
+The simplest way to get up and running with Docker is to use Docker Compose. See the docs on [Docker Hub](https://hub.docker.com/_/caddy) for more additional details about the official Caddy Docker image.
+
+
+
+### Setup
First, create a file `docker-compose.yml` (or add this service to your existing file):
```yaml
-version: "3.7"
+version: "3.9"
services:
caddy:
@@ -249,18 +261,64 @@ volumes:
caddy_config:
```
-Make sure to fill in `` with the latest version number, which you can find listed on [Docker Hub](https://hub.docker.com/_/caddy) under the "Tags" section.
+Make sure to fill in the image `` with the latest version number, which you can find listed on [Docker Hub](https://hub.docker.com/_/caddy) under the "Tags" section.
+
+What this does:
+
+- Uses the `unless-stopped` restart policy to make sure the Caddy container is restarted automatically when your machine is rebooted.
+- Binds to ports `80` and `443` for HTTP and HTTPS respectively, plus `443/udp` for HTTP/3.
+- Bind mounts the `Caddyfile` file which is your Caddy configuration.
+- Bind mounts the `site` directory to serve your site's static files from `/srv`.
+- Named volumes for `/data` and `/config` to [persist important information](/docs/conventions#file-locations).
Then, create a file named `Caddyfile` beside the `docker-compose.yml`, and write your [Caddyfile](/docs/caddyfile/concepts) configuration.
-If you have static files to serve, you may place them in a `site/` directory beside the configs, then set the [`root` directive](/docs/caddyfile/directives/root) to `/srv/`. If you don't, then you may remove the `/srv` volume mount.
+If you have static files to serve, you may place them in a `site/` directory beside the configs, then set the [`root`](/docs/caddyfile/directives/root) using `root * /srv`. If you don't, then you may remove the `/srv` volume mount.
+
+
+
+### Usage
Then, you can start the container:
-
docker-compose up -d
+
docker compose up -d
To reload Caddy after making changes to your Caddyfile:
-
+To see Caddy's 1000 most recent logs, and `f`ollow to see new ones streaming in:
+
docker compose logs caddy -n=1000 -f
+When using Docker for local development with HTTPS, you might use a [hostname](/docs/caddyfile/concepts#addresses) like `localhost` or `app.localhost`. This enables [Local HTTPS](/docs/automatic-https#local-https) using Caddy's local CA to issue certificates. This means that HTTP clients outside the container will not trust the TLS certificate served by Caddy. To solve this, you may install Caddy's root CA cert on your host machine's trust store:
+
+