Split config and data

Right now, ~/.homeassistant is used for a mixture of “configuration” (static stuff provided by me that I’d like to version control) and “data” (stuff modified and maintained by Home Assistant)

For example it has my YAML files (config), some auto-maintained YAML files like entity_registry.yaml, as well as home-assistant_v2.db and home-assistant.log and deps

This is a pain for snapshotting (I end up copying an entire git repo), this is a pain for Dockerisation (I can’t easily build an image with Home Assistant and my config and a mounted volume for the data dir)

With a proper split I could build my own fully-contained image with a pretty trivial Dockerfile:

FROM homeassistant/home-assistant:0.64.2

COPY . /config

and then just run with a volume mount for the data dir - then I’d have my own image for easy deployment with all my config baked in (let’s ignore secrets for now)


I don’t get the point: in the folder you have everything you need to restore your HA install from scratch. Some of the files created by HA (the entity registry, the devices registry) can be edited and customized by the user. The dependencies are only those for the custom components, the may be customized too.

For dockerization, this way you have a single folder needing persistent storage that should be accessible for reading and writing.

There is already a HA for docker, and Hassio is Docker-based too, why do you need to make your own dockerfile?

1 Like

I agree… I want the same behavior, I don’t want to check in its db or its runtime generated config files. I want to keep only config files I manage in my git repo.

I am going to do the same thing with my configs. Adding a .gitignore with the binary files is easy enough.