title: Docker搭建ServerStatus tags: [] id: '1997' categories:
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'
{
"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": [
]
}
sudo systemctl status ssc
[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