Add Dockerfile and root folder from upstream

This commit is contained in:
Lukáš Kucharczyk 2022-10-05 10:13:39 +02:00
parent dd3a481758
commit 467142db01
No known key found for this signature in database
5 changed files with 221 additions and 5 deletions

View File

@ -1,5 +1,116 @@
FROM scratch FROM ghcr.io/linuxserver/baseimage-alpine:3.15
RUN echo "hello world"
COPY example.txt / # set version label
ENV VAR=1 ARG BUILD_DATE
CMD ["sleep", "infinity"] ARG VERSION
ARG BEETS_VERSION
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="aptalca"
RUN \
echo "**** install build packages ****" && \
apk add --no-cache --virtual=build-dependencies --upgrade \
cmake \
ffmpeg-dev \
fftw-dev \
g++ \
gcc \
git \
jpeg-dev \
libpng-dev \
make \
mpg123-dev \
openjpeg-dev \
python3-dev && \
echo "**** install runtime packages ****" && \
apk add --no-cache --upgrade \
curl \
expat \
ffmpeg \
ffmpeg-libs \
fftw \
flac \
gdbm \
gst-plugins-good \
gstreamer \
jpeg \
jq \
lame \
libffi \
libpng \
mpg123 \
nano \
openjpeg \
py3-gobject3 \
py3-pip \
py3-pylast \
python3 \
sqlite-libs \
tar \
wget && \
echo "**** compile mp3gain ****" && \
mkdir -p \
/tmp/mp3gain-src && \
curl -o \
/tmp/mp3gain-src/mp3gain.zip -sL \
https://sourceforge.net/projects/mp3gain/files/mp3gain/1.6.1/mp3gain-1_6_1-src.zip && \
cd /tmp/mp3gain-src && \
unzip -qq /tmp/mp3gain-src/mp3gain.zip && \
sed -i "s#/usr/local/bin#/usr/bin#g" /tmp/mp3gain-src/Makefile && \
make && \
make install && \
echo "**** compile mp3val ****" && \
mkdir -p \
/tmp/mp3val-src && \
curl -o \
/tmp/mp3val-src/mp3val.tar.gz -sL \
https://downloads.sourceforge.net/mp3val/mp3val-0.1.8-src.tar.gz && \
cd /tmp/mp3val-src && \
tar xzf /tmp/mp3val-src/mp3val.tar.gz --strip 1 && \
make -f Makefile.linux && \
cp -p mp3val /usr/bin && \
echo "**** compile chromaprint ****" && \
git clone https://bitbucket.org/acoustid/chromaprint.git \
/tmp/chromaprint && \
cd /tmp/chromaprint && \
cmake \
-DBUILD_TOOLS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX:PATH=/usr && \
make && \
make install && \
echo "**** install pip packages ****" && \
if [ -z ${BEETS_VERSION+x} ]; then \
BEETS_VERSION=$(curl -sL https://pypi.python.org/pypi/beets/json \
|jq -r '. | .info.version'); \
fi && \
python3 -m pip install --upgrade pip && \
pip3 install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine/ \
wheel \
beautifulsoup4 \
beets==${BEETS_VERSION} \
beets-extrafiles \
discogs-client \
flask \
pillow \
pyacoustid \
requests \
unidecode && \
echo "**** cleanup ****" && \
apk del --purge \
build-dependencies && \
rm -rf \
/root/.cache \
/tmp/*
# environment settings
ENV BEETSDIR="/config" \
EDITOR="nano" \
HOME="/config"
# copy local files
COPY root/ /
# ports and volumes
EXPOSE 8337
VOLUME /config

26
root/defaults/beets.sh Normal file
View File

@ -0,0 +1,26 @@
#!/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)"
BEETSDIR=/config
export BEETSDIR
FPCALC=/usr/bin/fpcalc
export FPCALC
/usr/bin/beet -v import -q "$1"

63
root/defaults/config.yaml Normal file
View File

@ -0,0 +1,63 @@
plugins: fetchart embedart convert scrub replaygain lastgenre chroma web
directory: /music
library: /config/musiclibrary.blb
art_filename: albumart
threaded: yes
original_date: no
per_disc_numbering: no
convert:
auto: no
ffmpeg: /usr/bin/ffmpeg
opts: -ab 320k -ac 2 -ar 48000
max_bitrate: 320
threads: 1
paths:
default: $albumartist/$album%aunique{}/$track - $title
singleton: Non-Album/$artist - $title
comp: Compilations/$album%aunique{}/$track - $title
albumtype_soundtrack: Soundtracks/$album/$track $title
import:
write: yes
copy: no
move: yes
resume: ask
incremental: yes
quiet_fallback: skip
timid: no
log: /config/beet.log
lastgenre:
auto: yes
source: album
embedart:
auto: yes
fetchart:
auto: yes
replaygain:
auto: no
scrub:
auto: yes
replace:
'^\.': _
'[\x00-\x1f]': _
'[<>:"\?\*\|]': _
'[\xE8-\xEB]': e
'[\xEC-\xEF]': i
'[\xE2-\xE6]': a
'[\xF2-\xF6]': o
'[\xF8]': o
'\.$': _
'\s+$': ''
web:
host: 0.0.0.0
port: 8337

View File

@ -0,0 +1,11 @@
#!/usr/bin/with-contenv bash
# copy config
[[ ! -e /config/beets.sh ]] && \
cp /defaults/beets.sh /config/beets.sh
[[ ! -e /config/config.yaml ]] && \
cp /defaults/config.yaml /config/config.yaml
# permissions
chown -R abc:abc \
/config

View File

@ -0,0 +1,5 @@
#!/usr/bin/with-contenv bash
umask 022
exec \
s6-setuidgid abc beet web