Home assistant really benefits from being run as an OS. RaspPI or similar would legit be my recommendation.
For a media server though, I learned mostly by starting with these two repos: https://github.com/geekau/mediastack https://github.com/SimpleHomelab/Docker-Traefik
Both will get you where you want to go. Simple homelab is a much cleaner setup if you actually want to run a server as the compose is separated out into individual includes per container/stack, but is way overkill for your use case, even though the documentation should make it reasonably simple to adapt. Media stack does exactly what you are trying, but the organization of the server isnt as nice, and the associated documentation may be over your head. Its definitely over mine, but I'm a "poke it rill it works" guy and not a "just read the damn instructions" guy.
Apologies, Lemmy posted my prior comment before I was done. Please give it a reread. My compose is based heavily on the simple homelab setup, but I remember figuring out how to get Sab and my VPN cooperating off media stack.