Repository navigation
Expand file tree
/
Copy pathcompose.yaml
More file actions
83 lines (79 loc) · 3.62 KB
/
Copy pathcompose.yaml
File metadata and controls
83 lines (79 loc) · 3.62 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
# HEMSight – installation via Docker Compose.
#
# The images come prebuilt from the GitHub container registry. Nothing is compiled here.
# By default you get the newest release, so "docker compose pull && docker compose up -d"
# is all an update takes. To stay on one version, pin it in the .env.
#
# Three things are best left alone unless you have a good reason:
# - The service has to be called "backend". The web interface talks to it under exactly
# that name.
# - ./data is the only place your setup lives in. Without that line it is gone after the
# next "docker compose down".
# - /app/config is deliberately not mounted. The templates are inside the image; a
# mounted directory hides them and HEMSight then starts without factory settings.
services:
backend:
image: ghcr.io/markus660/hemsight-backend:${HEMSIGHT_VERSION:-latest}
container_name: ${HEMSIGHT_STACK_PREFIX:-hemsight}-backend
restart: unless-stopped
# Ohne .env startet HEMSight trotzdem: jeder Wert hier hat einen Standard, und der
# Schluessel darf leer bleiben. Ein vergessenes cp soll keinen Abbruch geben, den
# niemand deuten kann. Braucht Compose 2.24 oder neuer.
env_file:
- path: .env
required: false
volumes:
- ./data:/app/data
ports:
- "127.0.0.1:${HEMSIGHT_BACKEND_PORT:-18080}:8000"
# For wallboxes connecting over OCPP. Unlike the service above it, this port is
# reachable from your network. Without an OCPP wallbox the line can go.
- "${HEMSIGHT_OCPP_PORT:-9000}:9000"
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/api/healthz', timeout=5).read()"]
interval: 30s
timeout: 10s
retries: 3
# The first start sets up the data store and takes longer than the ones after it.
start_period: 180s
# EEBus counterpart for devices speaking SHIP/SPINE – heat pumps and wallboxes with
# EEBus support, for instance. Only starts when you ask for it:
# docker compose --profile eebus up -d
# The certificate in ./data/eebus has to survive. Lose it and HEMSight introduces itself
# as a stranger to every paired device, so each one has to trust it again.
eebus:
image: ghcr.io/markus660/hemsight-eebus:${HEMSIGHT_VERSION:-latest}
container_name: ${HEMSIGHT_STACK_PREFIX:-hemsight}-eebus
restart: unless-stopped
profiles: ["eebus"]
volumes:
- ./data/eebus:/data
ports:
- "${HEMSIGHT_EEBUS_PORT:-4712}:4712"
# If HEMSight doesn't find your EEBus devices, this is usually why: they announce
# themselves over mDNS, which often doesn't cross the Docker bridge network. Moving
# this service onto the host network fixes it – ports and network_mode have to be
# swapped, Compose rejects both together, and the backend can then no longer reach the
# service by name:
# 1. remove ports: above and set network_mode: host instead
# 2. add to the backend service:
# environment:
# EEBUS_SIDECAR_URL: http://host.docker.internal:4715
# extra_hosts:
# - "host.docker.internal:host-gateway"
# Untested, because there is no EEBus device here – reports are welcome.
frontend:
image: ghcr.io/markus660/hemsight-frontend:${HEMSIGHT_VERSION:-latest}
container_name: ${HEMSIGHT_STACK_PREFIX:-hemsight}-frontend
restart: unless-stopped
env_file:
- path: .env
required: false
depends_on:
backend:
condition: service_healthy
ports:
- "${HEMSIGHT_FRONTEND_PORT:-18081}:80"
networks:
default:
name: ${HEMSIGHT_STACK_PREFIX:-hemsight}