To get it running in Docker, I needed to emulate a separate host within the Synology NAS. Multiple virtual hosts with Docker macvlan Docker has a networking driver called macvlan that allows each container to have its own (virtualized) MAC address and IP address on the LAN.
- Docker Compose is system agnostic, meaning that the configuration file and data folders can be transferred to any other system running Docker Compose and it will function as expected. This is a stark difference from Synology’s Docker GUI, as you can back up the important container data, but you can’t port it over to a different operating.
- Deprecated environment variables: While these may still work, they are likely to be removed in a future version. Where applicible, alternative variable names are indicated.
- Windows users may need to disable the WSL 2 based engine in Docker Settings General to mount drives other than C.Please use this docker-compose.yml example to get started and increase the Docker memory limit to 4 GB or more, as the default of 2 GB may reduce indexing performance or cause restarts.
- This is the best option for most users, it lets you control and configure many containers and their interdependence in one file. A good starting place is docker’s own Get started with Docker Compose. You can use composerize or red5d/docker-autocomposeto convert docker run commands into a single docker-compose.yml file.
Home Assistant on Docker is easier than running it with HASSIO IMO.
Here is a high-altitude overview of how I run Home Assistant -and- then I’ll dig into the details of my setup.
Docker Compose Synology Tutorial
- Setup Raspbian with Docker and Docker-Compose
- Plugin my Aeon Z-wave script; make sure it’s on /dev/ttyACM0
- Setup scripts for Docker-Compose
- Setup scripts so it runs on startup
- Create a backup process
Okay, details… here is how I run Home Assistant on Docker on a Raspberry Pi 4.
- Install Raspbian on the Raspberry Pi 4.
- Install Docker and Docker-Compose.
- Create
/root/docker-compose.yml
consisting of the following (NOTE: I use the Aeon z-wave stick at /dev/ttyACM0):
- Create the following file for automating the service on startup
/etc/systemd/system/home-assistant.service
- Run this
systemctl enable home-assistant.service
- Run this
systemctl enable docker
Run Docker Compose Synology
[docker
home-automation
home-assistant
]