Docker搭建uptime kuma网站监控服务
date
Jun 3, 2022
slug
newservice-uptime-kuma-status-check
status
Published
summary
新服务 uptime kuma
tags
service
type
Post
URL
Summary
步骤
export DOCKER_PROJ=uptime-kuma
export DOCKER_PORT=18460
mkdir /data/$DOCKER_PROJ; cd /data/$DOCKER_PROJ
cat > docker-compose.yml <<EOF
version: '3.3'
services:
$DOCKER_PROJ:
container_name: $DOCKER_PROJ
image: louislam/uptime-kuma
restart: always
volumes:
- ./data:/app/data
#ports:
# - '$DOCKER_PORT:3001'
networks:
default:
name: npm_nginx_proxy_manager-network
external: true
EOF
docker-compose down; docker-compose up -d; sleep 1s; docker-compose logs -f
反代 - 通过nginx
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://uptime-kuma:3001/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}