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)

Thoughts?

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.

I found this because I wanted to do exactly this. All my other containers have splits between their logical volumes for config, data and other types of storage. I also find it rather confusing when I go to tweak something in HA and I can’t remember which file it’s in, and so I ls the /config folder and it’s just everything. I want it to just be my .yaml files, and then the data I should not be meddling with should be in a separate folder.

I was planning on doing some crazy docker file/folder mapping but I don’t think it’d work out in all cases (since HA seems to create these based on plugins and other things added too, so I might not know every necessary map). It would be really nice if there was a /data (or even /config/data) where all the data stuff was stored.