Docker搭建ServerStatus

服务端

1
2
3
4
5
6
7
8
9
10
11
12
version: '3.3'
services:
serverstatus:
restart: always
container_name: serverstatus
volumes:
- './serverstatus-config.json:/ServerStatus/server/config.json'
- './serverstatus-monthtraffic:/usr/share/nginx/html/json'
ports:
- '8001:80'
- '35601:35601'
image: 'cppla/serverstatus:latest'

客户端

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{
"servers": [
{
"username": "ld_rasp4",
"name": "ld_rasp4",
"type": "arm",
"host": "LD",
"location": "CN",
"password": "DEFAULT_PASSWORD",
"monthstart": 1
},
{
"username": "oc_blog",
"name": "oc_blog",
"type": "amd",
"host": "🇸🇬",
"location": "US",
"password": "DEFAULT_PASSWORD",
"monthstart": 1
}
],
"watchdog": [
]
}
  • 编辑 serverstatus-config.json
  • 重启服务端 sudo docker-compose restart
  • wget –no-check-certificate -qO client-linux.py ‘https://gogs.frp.limour.top/limour/ServerStatus/raw/master/clients/client-linux.py
  • chmod +x client-linux.py
  • 测试一下:/home/pi/client-linux.py SERVER=45.79.67.132 USER=ld_rasp4 PASSWORD=DEFAULT_PASSWORD INTERVAL=10
  • 创建system服务
  • sudo nano /etc/systemd/system/ssc.service
  • sudo systemctl enable ssc
  • sudo systemctl start ssc
  • sudo systemctl status ssc
1
2
3
4
5
6
7
8
9
[Unit]
Description=ServerStatus-Client
After=network.target
[Service]
ExecStart=/home/pi/client-linux.py SERVER=45.79.67.132 USER=ld_rasp4 PASSWORD=DEFAULT_PASSWORD INTERVAL=10
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
[Install]
WantedBy=multi-user.target

Docker搭建ServerStatus
https://occdn.limour.top/2281.html
Author
Limour
Posted on
August 27, 2022
Licensed under