Files
docker-voltronic-homeassistant/docker-compose.yml
T
Pi Developer c5645c0f2b
Build Docker Image for Raspberry Pi / build-and-push (push) Failing after 23s
Aggiunta configurazione tramite variabili d'ambiente e fix Docker Hub secrets
- Aggiunto supporto ENV variables nel Dockerfile:
  * INVERTER_DEVICE, MQTT_SERVER, MQTT_PORT, MQTT_TOPIC
  * MQTT_DEVICENAME, MQTT_USERNAME, MQTT_PASSWORD
  * FORCE_DISCOVERY, SKIP_DISCOVERY
- Implementata funzione update_mqtt_config() in entrypoint.sh
  * Aggiorna automaticamente mqtt.json da ENV variables all'avvio
  * Backup automatico configurazione originale
- Fix workflow Docker build:
  * Login Docker Hub solo se secrets configurati
  * Push solo se secrets disponibili (evita errori CI/CD)
  * Build funziona anche senza secrets (utile per test locali)
- Aggiornato docker-compose.yml con esempio ENV variables
- Creata documentazione completa DOCKER_SETUP.md:
  * Guida configurazione variabili d'ambiente
  * Esempi docker-compose e docker run
  * Guida configurazione secrets Gitea
  * Troubleshooting e health check

Ora è possibile configurare completamente il container senza modificare file
2026-01-31 16:21:42 +01:00

73 lines
1.8 KiB
YAML

version: '3'
services:
voltronic-mqtt:
# We're now (finally) supporting Multi-Arch builds (via Github actions) on Docker Hub!
image: bushrangers/ha-voltronic-mqtt
# Uncomment if you want to build your own local version.
#build:
# context: .
# dockerfile: Dockerfile.dev
container_name: voltronic-mqtt
privileged: true
restart: always
# Environment variables for auto-discovery
environment:
# Device configuration
- INVERTER_DEVICE=/dev/ttyUSB0
# MQTT Broker configuration
- MQTT_SERVER=192.168.1.37
- MQTT_PORT=1883
- MQTT_TOPIC=homeassistant
- MQTT_DEVICENAME=voltronic
- MQTT_USERNAME=mqtt_user
- MQTT_PASSWORD=your_password_here
# Auto-discovery options
# Force auto-discovery on every container start (default: false)
# Set to "true" to re-run discovery even if previous results exist
- FORCE_DISCOVERY=false
# Skip auto-discovery completely (default: false)
# Set to "true" to use only values from inverter.conf
- SKIP_DISCOVERY=false
volumes:
- ./config/:/etc/inverter/
devices:
# - "/dev/mem:/dev/mem"
# USB Port Mapping
- /dev/bus/usb:/dev/bus/usb:rwm
- /dev/ttyUSB0:/dev/ttyUSB0:rwm
- /dev/ttyUSB1:/dev/ttyUSB1:rwm
# Serial Port Mapping...
- /dev/ttyS0:/dev/ttyS0
- /dev/ttyS1:/dev/ttyS1
- /dev/ttyS2:/dev/ttyS2
# Used to auto-update images as we release new versions...
watchtower:
# Please see the following for configuration options:
# https://containrrr.github.io/watchtower/container-selection/
image: containrrr/watchtower
container_name: watchtower
restart: always
privileged: true
volumes:
- /var/run/docker.sock:/var/run/docker.sock
command: --interval 500