Files
lan-manager/docker-compose.yml
shirainbown 74bab47a5b feat: optimize ping interval to 30s and SSH sync to 10min with timeout protection
- Change ping interval from 60s to 30s (configurable via PING_INTERVAL)
- Change SSH info sync from every ping to every 10 minutes (via ssh_synced_at)
- Add SSH command timeout (8s) to prevent hanging on unresponsive hosts
- Add concurrency limit (5) for SSH sync operations
- Change frontend UI refresh interval from 10s to 30s
- Fix: remove hardcoded 30s step, use configured interval directly
- Fix: ensure ping loop continues even if individual machine fails
2026-06-19 18:08:06 +08:00

54 lines
1.4 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
version: '3.8'
services:
lan-manager:
build:
context: .
dockerfile: Dockerfile
image: lan-manager:latest
container_name: lan-manager
restart: unless-stopped
ports:
- "8080:8080"
volumes:
# 数据持久化SQLite 数据库和上传文件
- ./data:/app/data
environment:
# 基础配置
- HOST=0.0.0.0
- PORT=8080
- DATA_DIR=/app/data
- DB_PATH=/app/data/lan-manager.db
# 管理员配置(⚠️ 生产环境务必修改)
- ADMIN_USER=admin
- ADMIN_PASS=admin
# 安全密钥(⚠️ 生产环境务必修改)
- SESSION_SECRET=lan-manager-secret-change-in-production
- ENCRYPT_KEY=lan-manager-default-key-change-in-production
# 功能配置
- PING_INTERVAL=30
- SSH_TIMEOUT=10
- LOG_RETENTION_DAYS=0
- UI_REFRESH_INTERVAL=30000
# 日志级别
- LOG_LEVEL=info
# 如果需要容器能 ping 通局域网其他机器,可以使用 host 网络模式
# 或者使用 macvlan 网络让容器获得独立 IP
# network_mode: host
# 如果需要 ICMP ping 权限,可以添加 capabilities
# cap_add:
# - NET_RAW
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/api/health"]
interval: 30s
timeout: 5s
start_period: 10s
retries: 3