Hello
De mon côté :
Hardware: NUC6CAYS avec 6 Go de Ram.
SSD: 240 Go
Linux Ubuntu
Quasi tout est en docker.
En tout 23 dockers tournent sans aucune contrainte pour ni la RAM ni la charge CPU.
Le seul utilitaire qui n’est pas en docker et qui est lié directement avec Home Assistant est NGINX pour le reverse proxy.
Liste des dockers liés à Home Assistant:
image: mariadb/server:latest (pour remplacer la base standard)
image: nodered/node-red:latest
image: Package duckdns · GitHub
image: « infinityofspace/certbot_dns_duckdns:latest ». ( certificats let’s encrypt duckdns en dns-01’
image: influxdb:latest ( en version 2.0)
image: telegraf:latest
image: grafana/grafana:latest
image: grafana/grafana-image-renderer:latest
image: eclipse-mosquitto:latest
image: phpmyadmin:latest
image: pbranly/pygazpar_test:0.02.01 ( pour récupérer ma conso gaz vers InfluxDB )
image: esphome/esphome:latest
Plus bien d’autres sans relation avec HA
Phil
édit: ajout matériel.
edit: ajout docker-compose:
version: "3.8"
services:
# Define a home assistant service
homeassistant:
container_name: home-assistant
image: homeassistant/home-assistant:latest
# image: homeassistant/home-assistant:rc
environment:
- TZ=Europe/Paris
volumes:
- ./homeassistant:/config
- /etc/localtime:/etc/localtime:ro
entrypoint: /bin/bash -c "apk add firefox && python -m homeassistant --config /config"
network_mode: host
restart: unless-stopped
depends_on:
# MariaDB is optional (only if you would like to use a different database for HA).
- mariadb
- influxdb2
# Deconz is optional (only if you use the deconz Zigbee hub).
# - deconz
# user: "${LOCAL_USER}:${LOCAL_USER}"
#--------------------------------------------------------------
# Define a mariadb service
mariadb:
image: mariadb/server:latest
container_name: mariadb
restart: always
environment:
MYSQL_ROOT_PASSWORD: "${MYSQL_ROOT_PASSWORD}"
MYSQL_DATABASE: ha_db
MYSQL_USER: homeassistant
MYSQL_PASSWORD: "${HA_MYSQL_PASSWORD}"
# user: "${LOCAL_USER}:${LOCAL_USER}"
volumes:
# Local path where the database will be stored.
- ./mariadb:/var/lib/mysql
ports:
- "3306:3306"
#-------------------------------------------------------
# Define a portainer service
portainer:
image: portainer/portainer-ce:latest
container_name: portainer
environment:
- TZ=Europe/Paris
restart: always
ports:
- 9002:9000
- 8000:8000
command: -H unix:///var/run/docker.sock
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./portainer:/data
#--------------------------------------------------------------
# Define a node-red service
node-red:
image: nodered/node-red:latest
container_name: nodered
environment:
- TZ=Europe/Paris
depends_on:
- homeassistant
ports:
- "1880:1880"
# networks:
# - node-red-net
volumes:
- ./nodered:/data
restart: always
#-----------------------------------------------------------
# Define a watchtower service
watchtower:
image: containrrr/watchtower:latest
container_name: watchtower
environment:
- TZ=Europe/Paris
volumes:
- /var/run/docker.sock:/var/run/docker.sock
command: --interval 82800
restart: always
#-----------------------------------------------------------
# Define a duckdns service
duckdns:
image: ghcr.io/linuxserver/duckdns:latest
container_name: duckdns
environment:
- PUID=1000 #optional
- PGID=1000 #optional
- TZ=Europe/Paris
- SUBDOMAINS=xxxxxxxxx #<--------------------- a modifier
- TOKEN=xxxxxxxxxxxxxxxxxxxxx #<--------------------- a modifier
- LOG_FILE=true #optional
volumes:
- ./duckdns/config:/config #optional
restart: always
#----------------------------------------------------------
# Define a certbot duckdns service
certbot:
image: "infinityofspace/certbot_dns_duckdns:latest"
container_name: "certbot_dns_duckdns"
command: certonly
--non-interactive
--agree-tos
--email ${EMAIL_certbot}
--preferred-challenges dns
--authenticator dns-duckdns
--dns-duckdns-token ${TOKEN_duckdns}
--dns-duckdns-propagation-seconds 30
-d ${DOMAIN_certbot}
volumes:
- "/etc/letsencrypt:/etc/letsencrypt"
- "./certbot:/var/log/letsencrypt"
# nota : add the following line in the cron ( except if using certbot cron service): docker run --rm -v "/etc/letsencrypt:/etc/letsencrypt" -v "/home/docker/certbot:/var/log/letsencrypt" infinityofspace/certbot_dns_duckdns:latest certbot renew
# Define a certbot cron service ( only if previous cron is not used)
certbot_cron:
build: /home/docker/certbot/cron
container_name: "certbot_cron"
restart: unless-stopped
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
environment:
- CERTBOT_CONTAINER_NAME=certbot_dns_duckdns
#-----------------------------------------------------------
# Define a influxdb2 service
influxdb2:
image: influxdb:latest
container_name: influxdb2
ports:
- '8087:8086'
volumes:
- ./influxdb2/data:/var/lib/influxdb2
- ./influxdb2/config:/etc/influxdb2
environment:
- DOCKER_INFLUXDB_INIT_MODE=setup
- DOCKER_INFLUXDB_INIT_USERNAME=${INFLUXDB_ADMIN_USER}
- DOCKER_INFLUXDB_INIT_PASSWORD=${INFLUXDB_ADMIN_PASSWORD}
- DOCKER_INFLUXDB_INIT_ORG=home
- DOCKER_INFLUXDB_INIT_BUCKET=bucket0
- DOCKER_INFLUXDB_INIT_RETENTION=1w
- DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=${INFLUXDB_INIT_ADMIN_TOKEN}
- TZ=Europe/Paris
restart: always
networks:
- monitoring_network
#-------------------------------------------------------
# Define a telegraf service
telegraf:
image: telegraf:latest
container_name: telegraf
environment:
- TZ=Europe/Paris
ports:
- 6514:6514
depends_on:
- influxdb2
networks:
- monitoring_network
links:
- influxdb2
environment:
HOST_PROC: /rootfs/proc
HOST_SYS: /rootfs/sys
HOST_ETC: /rootfs/etc
volumes:
- ./telegraf/telegraf.conf:/etc/telegraf/telegraf.conf:ro
- /var/run/docker.sock:/var/run/docker.sock # nécessaire pour remonter les données du démon Docker
- /sys:/rootfs/sys:ro
- /proc:/rootfs/proc:ro
- /etc:/rootfs/etc:ro
restart: always
#
# to get the telegraf.conf use the following command : docker run --rm telegraf telegraf config > telegraf/telegraf.conf
#-------------------------------------------------------
# Define a grafana service
grafana:
image: grafana/grafana:latest
container_name: grafana
restart: always
user: "0"
ports:
- 3000:3000
networks:
- monitoring_network
links:
- influxdb2:influxdb2
environment:
- GF_RENDERING_SERVER_URL= "http://renderer:8081/render"
- GF_RENDERING_CALLBACK_URL=http://grafana:3000
- GF_LOG_FILTERS= "rendering=debug"
- GF_INSTALL_PLUGINS=grafana-clock-panel,grafana-influxdb-08-datasource,grafana-kairosdb-datasource,grafana-piechart-panel,grafana-simple-json-datasource,grafana-worldmap-panel,farski-blendstat-panel,blackmirror1-singlestat-math-panel,yesoreyeram-boomtable-panel,pr0ps-trackmap-panel
- GF_SECURITY_ALLOW_EMBEDDING=true
- GF_AUTH_ANONYMOUS_ENABLED=true
- TZ=Europe/Paris
volumes:
- ./grafana:/var/lib/grafana
- ./grafana/log:/var/log/grafana
- ./grafana/config/custom.ini:/etc/grafana/grafana.ini
depends_on:
- renderer
- influxdb2
# nota: cd to /home/docker then
# docker run --rm --entrypoint /bin/bash grafana/grafana:latest -c 'cat $GF_PATHS_CONFIG' > grafana.ini
# copy in /home/grafana/config as custom.ini
#------------------------------------------
# Define a renderer service
renderer:
image: grafana/grafana-image-renderer:latest
container_name: renderer
restart: always
ports:
- 8081:8081
networks:
- monitoring_network
#. volumes:
# - /home/docker/renderer/config.json:/usr/src/app/config.json
environment:
ENABLE_METRICS: 'true'
#------------------------------------------------------
# Define a mqtt service
mqtt:
container_name: mosquitto
image: eclipse-mosquitto:latest
environment:
- TZ=Europe/Paris
restart: always
ports:
- "1883:1883"
- "9003:9001"
volumes:
- ./mosquitto/config/mosquitto.conf:/mosquitto/config/mosquitto.conf
- ./mosquitto/log:/mosquitto/log
- ./mosquitto/data:/mosquitto/data
#-----------------------------------------------------------
# Define a phpmyadmin service
phpmyadmin:
container_name: phpmyadmin
image: phpmyadmin:latest
restart: always
ports:
- 8085:80
environment:
- PMA_ARBITRARY=1
- TZ=Europe/Paris
volumes:
- ./phpmyadmin/config.user.inc.php:/etc/phpmyadmin/config.user.inc.php
#---------------------------------------
#define a pygazpar2 service
pygazpar2:
container_name: pygazpar2
image: pbranly/pygazpar_test:0.02.01
command: pygazpar_to_influxdb.py --influxdb2-host 192.168.1.8:8087 --influxdb2-token xxxxxxxxxxxxxxxxxx --influxdb2-bucket home_assistant --influxdb2-org home --pygazpar-login 'xxxxx@xxxxx.fr' --pygazpar-password 'xxxxxxxxxxxxx' -vvv
depends_on:
- influxdb2
#------------------------------------------
# define a esphome service
esphome:
container_name: ESPHome
environment:
- TZ=Europe/Paris
volumes:
- './esphome:/config'
restart: always
network_mode: host
image: esphome/esphome:latest
# devices:
# - /dev/ttyUSB0:/dev/ttyUSB0
#---------------------------------
# define a dashy service
dashy:
image: lissy93/dashy:latest
container_name: Dashy
# Pass in your config file below, by specifying the path on your host machine
volumes:
- ./dashy/my-config.yml:/app/public/conf.yml
- ./dashy/icons/:/app/public/item-icons/
ports:
- 4000:80
# Set any environmental variables
environment:
- NODE_ENV=production
# Specify your user ID and group ID. You can find this by running `id -u` and `id -g`
- UID=0
- GID=0
# Specify restart policy
restart: unless-stopped
# Configure healthchecks
healthcheck:
test: ['CMD', 'node', '/app/services/healthcheck']
interval: 1m30s
timeout: 10s
retries: 3
start_period: 40s
#---------------------------------------------
networks:
# node-red-net:
monitoring_network: