# 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'

- mkdir -p ~/sss && cd ~/sss
- wget –no-check-certificate -qO ./serverstatus-config.json https://raw.githubusercontent.com/cppla/ServerStatus/master/server/config.json && mkdir ./serverstatus-monthtraffic
- nano docker-compose.yml
- sudo docker-compose up -d
- NPM面板反代8001端口，并设置域名解析。

## 客户端

    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
Docker安装A面板 Previous
AWS的Lambda使用尝试 Next

#### Search

Keyword