1
0
Fork 0
beets/Dockerfile

59 lines
2.3 KiB
Docker
Raw Normal View History

2024-06-02 14:43:45 +00:00
# static ffmpeg to use (built in other docker container)
# https://github.com/jrottenberg/ffmpeg
FROM my-ffmpeg-static:latest as builder
# main os for image
FROM ubuntu:20.04
# statically built ffmpeg
COPY --from=builder /ffmpeg /usr/local/bin/
COPY --from=builder /ffprobe /usr/local/bin/
# base os packages needed
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && apt upgrade -y \
&& apt install -y wget nano sqlite jq less git imagemagick python3 python3-pip \
&& apt install -y libqt5concurrent5 libqt5core5a libtag1v5 python3-dev libchromaprint-dev libeigen3-dev libfftw3-dev libsamplerate0 libyaml-dev libavformat58 libavfilter7 libswresample3 libavcodec58 libswscale5 libavdevice58 libavutil56 \
&& mkdir /opt/tmp/ \
&& cd /opt/tmp/ \
&& wget https://github.com/acoustid/chromaprint/releases/download/v1.5.1/chromaprint-fpcalc-1.5.1-linux-x86_64.tar.gz \
&& tar -xzf chromaprint-fpcalc-1.5.1-linux-x86_64.tar.gz \
&& mv chromaprint*/fpcalc /usr/local/bin \
&& wget https://github.com/doctorfree/mpplus-essentia/releases/download/v1.0.1r2/mpplus-essentia_1.0.1-2.amd64.deb \
&& dpkg -i mpplus-essentia_1.0.1-2.amd64.deb
# add beets user
RUN useradd -u 1000 -m -d /home/beets -s /bin/bash beets
# ensure perms on /opt are proper
RUN chown -R 1000 /opt
# flip to non-root user and setup beets as a user app/install
USER 1000
RUN pip install --user -U numpy \
&& pip install --user -U flask pyacoustid pylast requests pillow \
&& pip install --user -U git+https://github.com/beetbox/beets.git \
&& pip install --user -U beets-xtractor beets-describe beets-alternatives \
&& pip install --user -U git+https://github.com/steven-murray/beet-summarize.git
# general env stuff
ENV BEETSDIR="/opt/music/beets/"
ENV EDITOR="nano"
RUN echo "export PATH=/home/beets/.local/bin:${PATH}" >> /home/beets/.bashrc
COPY bash_aliases /home/beets/.bash_aliases
COPY duplicate_alternatives.py /usr/local/bin/duplicate_alternatives.py
WORKDIR /opt/music
# volumes
VOLUME /opt/music/beets
VOLUME /opt/music/library
VOLUME /opt/music/to_import
VOLUME /opt/music/alternatives
VOLUME /opt/music/unimported
VOLUME /opt/music/missing
VOLUME /opt/music/dupes
# port for beets web ui
EXPOSE 8337
# just run bash, let folk do whatever they need and however they want
ENTRYPOINT ["/bin/bash"]