Fix Caddy setup in Install Netdata with Docker (#17901)
Related to https://github.com/netdata/netdata/issues/17899. Netdata docker-compose setup is updated to match one in "Recommended way" section.
Alex Efros committed
Jun 14, 2024 at 19:17 UTC
0c43d1544ffba4fae9d60228fc78bad7e9725869
1 file changed
+7
-3
packaging/docker/README.md
+7
-3
@@ -308,7 +308,7 @@ executed internally by the caddy server.
308
309
```caddyfile
310
netdata.example.org {
311
- reverse_proxy netdata:19999
311
+ reverse_proxy host.docker.internal:19999
312
tls admin@example.org
313
}
314
```
@@ -318,11 +318,15 @@ netdata.example.org {
318
After setting Caddyfile run this with `docker-compose up -d` to have a fully functioning Netdata setup behind an HTTP reverse
319
proxy.
320
321
+Make sure Netdata bind to docker0 interface if you've custom `web.bind to` setting in `netdata.conf`.
322
+
323
```yaml
324
version: '3'
325
services:
326
caddy:
327
image: caddy:2
328
+ extra_hosts:
329
+ - "host.docker.internal:host-gateway" # To access netdata running with "network_mode: host".
330
ports:
331
- "80:80"
332
- "443:443"
@@ -333,9 +337,9 @@ services:
337
netdata:
338
image: netdata/netdata
339
container_name: netdata
336
- hostname: example.com # set to fqdn of host
337
- restart: always
340
pid: host
341
+ network_mode: host
342
+ restart: unless-stopped
343
cap_add:
344
- SYS_PTRACE
345
- SYS_ADMIN