Moved from Nginx to Caddy
This commit is contained in:
parent
203e51c576
commit
cfc9ddec9e
@ -1,9 +1,13 @@
|
|||||||
---
|
---
|
||||||
x-logging: &default-logging
|
x-logging:
|
||||||
driver: local
|
&default-logging
|
||||||
|
driver: syslog
|
||||||
options:
|
options:
|
||||||
max-size: "1m"
|
# This requires two files in /etc/rsyslog.d
|
||||||
max-file: "50"
|
# https://www.loggly.com/use-cases/docker-syslog-logging-and-troubleshooting/
|
||||||
|
tag: "container_name/{{.Name}}"
|
||||||
|
labels: "${hostname}"
|
||||||
|
syslog-facility: # cron, local7, etc.
|
||||||
|
|
||||||
x-opt-values: &volume-opt
|
x-opt-values: &volume-opt
|
||||||
driver_opts: &options
|
driver_opts: &options
|
||||||
@ -25,17 +29,27 @@ services:
|
|||||||
security_opt:
|
security_opt:
|
||||||
- apparmor:unconfined
|
- apparmor:unconfined
|
||||||
volumes:
|
volumes:
|
||||||
- netdataconfig:/etc/netdata:ro
|
- ./netdataconfig:/etc/netdata:rw
|
||||||
- netdatalib:/var/lib/netdata
|
- netdatalib:/var/lib/netdata
|
||||||
- netdatacache:/var/cache/netdata
|
- netdatacache:/var/cache/netdata
|
||||||
- /etc/passwd:/host/etc/passwd:ro
|
- /etc/passwd:/host/etc/passwd:ro
|
||||||
- /etc/group:/host/etc/group:ro
|
- /etc/group:/host/etc/group:ro
|
||||||
|
# - /dev:/host/dev:ro
|
||||||
|
# - /mnt:/host/mns:ro
|
||||||
|
# - /var/log:/host/var/log:ro
|
||||||
- /proc:/host/proc:ro
|
- /proc:/host/proc:ro
|
||||||
- /sys:/host/sys:ro
|
- /sys:/host/sys:ro
|
||||||
- /etc/os-release:/host/etc/os-release:ro
|
- /etc/os-release:/host/etc/os-release:ro
|
||||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||||
|
labels:
|
||||||
|
caddy: ${NETDATA_HOSTNAME}
|
||||||
|
caddy.log:
|
||||||
|
caddy.encode: "zstd gzip"
|
||||||
|
caddy.reverse_proxy: "{{upstreams 19999}}"
|
||||||
|
caddy.basicauth.{USERNAME}: "hashed_password"
|
||||||
networks:
|
networks:
|
||||||
- reverse-proxy
|
- netdata
|
||||||
|
- caddy
|
||||||
- npg
|
- npg
|
||||||
logging: *default-logging
|
logging: *default-logging
|
||||||
|
|
||||||
@ -43,33 +57,46 @@ services:
|
|||||||
image: prom/prometheus
|
image: prom/prometheus
|
||||||
container_name: prometheus
|
container_name: prometheus
|
||||||
hostname: prometheus
|
hostname: prometheus
|
||||||
|
# Only if you need to access it locally
|
||||||
|
# ports:
|
||||||
|
# - "9090:9090"
|
||||||
env_file:
|
env_file:
|
||||||
prometheus.env
|
prometheus.env
|
||||||
volumes:
|
volumes:
|
||||||
- prometheus:/etc/prometheus
|
- prometheus:/etc/prometheus
|
||||||
networks:
|
command:
|
||||||
|
- '--config.file=/etc/prometheus/prometheus.yml'
|
||||||
|
- '--storage.tsdb.path=/prometheus'
|
||||||
|
- '--storage.tsdb.retention.time=180d'
|
||||||
|
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
|
||||||
|
- '--web.console.templates=/usr/share/prometheus/consoles'
|
||||||
|
# - '--web.enable-admin-api'
|
||||||
|
# - '--web.enable-remote-write-receiver'
|
||||||
|
networks:
|
||||||
- npg
|
- npg
|
||||||
|
- caddy
|
||||||
logging: *default-logging
|
logging: *default-logging
|
||||||
|
|
||||||
grafana:
|
grafana:
|
||||||
image: grafana/grafana
|
image: grafana/grafana
|
||||||
container_name: grafana
|
container_name: grafana
|
||||||
|
restart: unless-stopped
|
||||||
env_file:
|
env_file:
|
||||||
grafana.env
|
grafana.env
|
||||||
volumes:
|
volumes:
|
||||||
- grafana:/var/lib/grafana
|
- grafana:/var/lib/grafana
|
||||||
|
labels:
|
||||||
|
caddy: grafana.domain.tld
|
||||||
|
caddy.log:
|
||||||
|
caddy.reverse_proxy: "{{upstreams 3000}}"
|
||||||
networks:
|
networks:
|
||||||
- npg
|
- npg
|
||||||
|
- caddy
|
||||||
logging: *default-logging
|
logging: *default-logging
|
||||||
|
|
||||||
# Can be substituted by a standard volume declaration if it's just a test
|
# Can be substituted by a standard volume declaration if it's just a test
|
||||||
# environment or no nfs server is available
|
# environment or no nfs server is available
|
||||||
volumes:
|
volumes:
|
||||||
netdataconfig:
|
|
||||||
<<: *volume-opt
|
|
||||||
driver_opts:
|
|
||||||
<<: *options
|
|
||||||
device: ":/mnt/path/netdata/netdataconfig"
|
|
||||||
netdatalib:
|
netdatalib:
|
||||||
<<: *volume-opt
|
<<: *volume-opt
|
||||||
driver_opts:
|
driver_opts:
|
||||||
@ -92,7 +119,7 @@ volumes:
|
|||||||
device: ":/mnt/path/grafana/grafana"
|
device: ":/mnt/path/grafana/grafana"
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
reverse-proxy:
|
netdata:
|
||||||
name: rp_reverse-proxy
|
|
||||||
external: true
|
|
||||||
npg:
|
npg:
|
||||||
|
caddy:
|
||||||
|
external: true
|
||||||
|
|||||||
@ -1,3 +1 @@
|
|||||||
VIRTUAL_HOST="grafana.domain.tld"
|
|
||||||
VIRTUAL_PORT=3000
|
|
||||||
LETSENCRYPT_HOST="grafana.domain.tld"
|
|
||||||
|
|||||||
@ -1,6 +1,3 @@
|
|||||||
VIRTUAL_HOST="netdata.domain.tld"
|
NETDATA_CLAIM_TOKEN=${TOKEN}
|
||||||
VIRTUAL_PORT=19999
|
|
||||||
LETSENCRYPT_HOST="netdata.domain.tld"
|
|
||||||
NETDATA_CLAIM_TOKEN=hOOww34Yc-6vYBYxRKBop6Ozbsf0B2WSaPBTsW_mbHuBYiHcGDVsvbqETz5SaevMvOVBK_4r7q6WwLZTTD3iwHy2T2X1NsRExqUWWUn3LQXDGYlvKKCynVRafuNT9xmH1cuQ0l8
|
|
||||||
NETDATA_CLAIM_URL=https://app.netdata.cloud
|
NETDATA_CLAIM_URL=https://app.netdata.cloud
|
||||||
NETDATA_CLAIM_ROOMS=
|
NETDATA_CLAIM_ROOMS=
|
||||||
|
|||||||
@ -1,3 +1 @@
|
|||||||
VIRTUAL_HOST="prometheus.domain.tld"
|
|
||||||
VIRTUAL_PORT=9090
|
|
||||||
LETSENCRYPT_HOST="prometheus.domain.tld"
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user