Skip to content

Instantly share code, notes, and snippets.

@devster31
Last active January 8, 2023 02:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devster31/83719fa8dc9384664a2faa85a6147cec to your computer and use it in GitHub Desktop.
Save devster31/83719fa8dc9384664a2faa85a6147cec to your computer and use it in GitHub Desktop.
[Beets Docker] #config #software
directory: /Volumes/Multimedia/Music
library: /Volumes/Archive/Scripts/beets/_musiclibrary.blb
import:
copy: yes
move: no
write: yes
log: beetslog.txt
art: yes
timid: yes
ignore: .AppleDouble ._* *~ .DS_Store
ignore_hidden: yes
art_filename: cover
original_date: yes
plugins: smartplaylist the discogs fetchart embedart lyrics fromfilename acousticbrainz
discogs:
va_name: "Various Artists"
pluginpath:
/Library/Python/2.7/site-packages/beetsplug/
the:
a: no
copyartifacts:
extensions: .m3u .cue .log .jpg .png .jpeg .nfo .pdf .txt .accurip
print_ignored: yes
embedart:
auto: yes
remove_art_file: no
lastgenre:
auto: yes
force: yes
count: 4
separator: ', '
whitelist: yes
paths:
default: %the{$albumartist}/$year - $album%aunique{}/$track - $title
ext:log: $albumpath/artifacts/$artist - $album
ext:cue: $albumpath/artifacts/$artist - $album
ext:jpg: $albumpath/artifacts/art
ext:pdf: $albumpath/artifacts/
singleton: Non-Album/$artist/$title
comp: Compilations/$year - $album%aunique{}/$track - $title
albumtype:soundtrack: Soundtracks/$year - $album/$track - $title
FROM lsiobase/alpine
ARG VERSION
ARG AUDIOTOOLS_VERSION
ENV \
BEETS_VERSION="$VERSION" \
AUDIOTOOLS_VERSION="$AUDIOTOOLS_VERSION" \
# environment settings
BEETSDIR="/config" \
HOME="/config" \
EDITOR="vim"
LABEL \
org.label-schema.name="beets" \
org.label-schema.url="https://beets.io" \
org.label-schema.vcs-url="https://github.com/beetbox/beets" \
org.label-schema.docker.cmd="docker run -it --rm -e PUID=`id -u` -e PGID=`id -g` -e TZ=Europe/Rome -p 8337:8337 -v {CONFIG_DIR}:/config -v {DUMP_DIR}:/downloads -v {MUSIC_DIR}:/music beets /bin/bash -l -c 'su -s /bin/bash -p abc'" \
org.label-schema.version="$VERSION" \
org.label-schema.schema-version="1.0.0-rc.1"
# install build packages
RUN \
apk add --no-cache --virtual=.build-dependencies \
ffmpeg-dev \
g++ \
gcc \
git \
jpeg-dev \
lame-dev \
libpng-dev \
make \
python3-dev \
zlib-dev \
&& \
# install runtime packages
apk add --no-cache \
curl \
expat \
ffmpeg \
ffmpeg-libs \
gdbm \
imagemagick \
jpeg \
lame \
python3 \
sqlite-libs \
tar \
vim \
&& \
python3 -m ensurepip --upgrade \
&& \
# compile chromaprint
apk add --update --no-cache \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
chromaprint \
&& \
DEPS="\
beets[\
absubmit,\
chroma,\
discogs,\
fetchart,\
import,\
lastgenre,\
web\
]==$BEETS_VERSION" \
&& \
pip3 install --upgrade --no-cache-dir \
setuptools \
${DEPS//[[:blank:]]/} \
beets==$BEETS_VERSION \
&& \
pip3 install --no-cache-dir \
git+https://github.com/sbarakat/beets-copyartifacts.git \
&& \
pip3 install --no-cache-dir \
https://github.com/tuffy/python-audio-tools/archive/v${AUDIOTOOLS_VERSION}.tar.gz \
&& \
# cleanup
apk del --purge .build-dependencies && \
rm -rf /root/.cache /tmp/*
# copy local files
COPY root/ /
# ports and volumes
EXPOSE 8337
VOLUME /config /downloads /music
#!/bin/bash
#
# beets music tagger - post-processing script
#
# Author: Rich Manton (overbyrn)
# Date: 29-04-13
#
# $1 - Fullpath of directory to be processed. eg./mnt/user/downloads/some.artist_some.album
# $7 - Status of post processing. 0 = OK, 1 = failed verification, 2 = failed unpack, 3 = 1+2
if [ ! -z "$7" ] && [ "$7" -gt 0 ]; then
echo "post-processing failed, bypassing script"
exit 1
fi
# process files
echo "--------------------------"
printf %b "$(date)\n"
echo "Starting beets.sh for $(basename $1)"
FPCALC=`command -v fpcalc`
if [ -e "${FPCALC}" ]
then
export "${FPCALC}"
else
>&2 echo "Couldn't find the fpcalc binary."
fi
/usr/local/bin/beet -v import -q "$1"
#!/usr/bin/with-contenv bash
# copy config
[[ ! -e /config/beets.sh ]] && \
cp /defaults/beets.sh /config/beets.sh
# permissions
chown -R abc:abc \
/config
# /downloads and /music need to be manually chowned if wished
# because running this command on each container execution
# can slow down the startup quite a lot
#!/usr/bin/with-contenv bash
umask 022
exec \
s6-setuidgid abc beet web
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment