Thinking of moving to a container for my main / ‘production’ beets instance. In theory it will be easier to move it between servers / devices, and allow it to play nice with other stuff on my NAS (similar to a python virtualenv).
Anyone have thoughts? Anyone using it currently? Looks like linuxserver is the only one actively supported.
I currently use a container with a custom Dockerfile for running beets on my NAS (easier than installing Python and a bunch of other dependencies). It probably doesn’t use many (or any) of the best practices when working with Docker but it suits my needs pretty well.
This allows me to just do ./beet.sh import /music/To\ Import without having to worry about messing with docker every time I run beets. This script could probably be improved somewhat in its volume mapping behaviour (maybe mapping the current working directory or doing something clever with argument parsing?), but it works well for my needs.
For context, my setup is that /mnt/user/music/Music contains my music library, with the configuration living at /mnt/user/music/Music/.beets. I’ve also got directory set in my beets configuration so that it points to /music/Music in the container.
I’ve found that --tty doesn’t play nice with piping output into other tools. Here’s an updated version of the script which omits --tty if output is not a terminal:
#!/bin/bash
ID=$(docker build -qt beets .) || exit $?
ARGS=(
--env BEETSDIR=/music/Music/.beets
--rm
--interactive
--volume /mnt/user/music:/music
)
if [ -t 1 ]; then
ARGS+=(--tty)
fi
ARGS+=(
"$ID"
beet
"$@"
)
docker run "${ARGS[@]}"
I’m using the container from linuxserver.io.
It makes it’s work pretty well and the mounting is already done.
The config.yaml is easy to edit as it gets mounted in the host.
So I just can recommend it.
Especially, the implementation of the web interface is pretty easy if you’re using docker and a reverse proxy as traefik.