feat(netdata): 添加netdata监控服务的docker部署配置

添加docker-compose配置文件、环境变量配置和netdata配置文件,用于快速部署netdata监控服务
This commit is contained in:
2025-10-07 17:29:02 +08:00
parent e89d44b27c
commit 880ed33d3d
3 changed files with 38 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
# docker exec -it netdata bash
# cd /etc/netdata
# ./edit-config netdata.conf

2
netdata/env.cfg Normal file
View File

@@ -0,0 +1,2 @@
IMAGE_TAG=netdata/netdata:edge-0
Volumes_Path=/data/volumes/netdata

33
netdata/stack.yml Normal file
View File

@@ -0,0 +1,33 @@
## PULL:: docker compose --env-file ./netdata/env.cfg -f ./netdata/stack.yml pull
## RUN:: docker compose -p netdata --env-file ./netdata/env.cfg -f ./netdata/stack.yml up -d
services:
netdata:
image: ${IMAGE_TAG}
container_name: netdata_dashboard
hostname: my_docker_compose_netdata
pid: host
network_mode: host
restart: unless-stopped
cap_add:
- SYS_PTRACE
- SYS_ADMIN
security_opt:
- apparmor:unconfined
volumes:
- ${Volumes_Path}/config:/etc/netdata
- netdatalib:/var/lib/netdata
- netdatacache:/var/cache/netdata
- /:/host/root:ro,rslave
- /etc/passwd:/host/etc/passwd:ro
- /etc/group:/host/etc/group:ro
- /etc/localtime:/etc/localtime:ro
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /etc/os-release:/host/etc/os-release:ro
- /var/log:/host/var/log:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
volumes:
netdatalib:
netdatacache: