Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
83 lines (80 loc) · 2.49 KB
/
Copy pathdocker-compose.yml
File metadata and controls
83 lines (80 loc) · 2.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
services:
modbus:
build:
context: .
dockerfile: Dockerfile
image: ghcr.io/checkmysolar/modbus-bridge:latest
restart: unless-stopped
read_only: true
tmpfs:
- /tmp
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
deploy:
resources:
limits:
memory: 256M
cpus: "0.5"
environment:
CMS_BRIDGE_TOKEN: ${CMS_BRIDGE_TOKEN:?CMS_BRIDGE_TOKEN is required}
MODBUS_HOST: ${MODBUS_HOST:?MODBUS_HOST is required}
MODBUS_PORT: ${MODBUS_PORT:-502}
MODBUS_UNIT_ID: ${MODBUS_UNIT_ID:-247}
POLL_INTERVAL_MS: ${POLL_INTERVAL_MS:-10000}
MODBUS_TIMEOUT_MS: ${MODBUS_TIMEOUT_MS:-5000}
# Optional: force register profile (h1g2, h1Series, kh, h3Legacy, h3Modern)
INVERTER_PROFILE: ${INVERTER_PROFILE:-}
# Optional: aux (RS485 adapter, default) or lan (direct inverter LAN)
MODBUS_CONNECTION: ${MODBUS_CONNECTION:-aux}
# Set to false to allow Check My Solar to make Modbus writes, such as setting work mode
MODBUS_READ_ONLY: ${MODBUS_READ_ONLY:-true}
BRIDGE_HOSTNAME: ${BRIDGE_HOSTNAME:?BRIDGE_HOSTNAME is required}
SITE_TIMEZONE: ${SITE_TIMEZONE:?SITE_TIMEZONE is required}
CMS_NOTIFICATIONS_ENABLED: ${CMS_NOTIFICATIONS_ENABLED:-false}
BRIDGE_VERBOSE_LOG: ${BRIDGE_VERBOSE_LOG:-false}
MODBUS_DEBUG_LOG: ${MODBUS_DEBUG_LOG:-false}
networks:
cms_net:
aliases:
- ${BRIDGE_HOSTNAME}
volumes:
- bridge_data:/data
# Do not publish port 8080 to the host — cloudflared reaches the bridge on the internal network only.
healthcheck:
test:
[
"CMD",
"/nodejs/bin/node",
"-e",
"fetch('http://127.0.0.1:8080/v1/health').then((r) => process.exit(r.ok ? 0 : 1)).catch(() => process.exit(1))",
]
interval: 30s
timeout: 5s
start_period: 15s
retries: 3
cloudflared:
image: cloudflare/cloudflared:2026.10.5
restart: unless-stopped
read_only: true
tmpfs:
- /tmp
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
command: tunnel --metrics 127.0.0.1:60123 --no-autoupdate run --token ${TUNNEL_TOKEN:?TUNNEL_TOKEN is required}
healthcheck:
test: ["CMD", "cloudflared", "tunnel", "--metrics", "127.0.0.1:60123", "ready"]
interval: 30s
timeout: 5s
start_period: 10s
retries: 3
networks:
- cms_net
networks:
cms_net:
driver: bridge
volumes:
bridge_data: