Add caddy server for remote playback

This commit is contained in:
IamTheFij 2020-11-18 10:34:50 -08:00
parent 431183135a
commit 07f5555695
3 changed files with 21 additions and 2 deletions

View File

@ -1,5 +1,14 @@
from python:3 from python:3
# Add Vim for command line editing on import
RUN apt-get update && apt-get install -y --no-install-recommends vim
ENV EDITOR=vim
# Install Caddy file server
ADD https://caddyserver.com/api/download?os=linux&arch=amd64&idempotency=72456813110731 \
/usr/bin/caddy
EXPOSE 9000
COPY requirements.txt ./ COPY requirements.txt ./
RUN pip install -r ./requirements.txt RUN pip install -r ./requirements.txt
@ -7,7 +16,7 @@ RUN mkdir /beets
VOLUME /beets VOLUME /beets
ENV BEETSDIR=/beets ENV BEETSDIR=/beets
RUN apt-get update && apt-get install -y --no-install-recommends vim COPY ./config.yaml ./
ENV EDITOR=vim COPY ./play.sh ./
ENTRYPOINT ["/usr/local/bin/beet"] ENTRYPOINT ["/usr/local/bin/beet"]

View File

@ -47,3 +47,4 @@ duplicates:
play: play:
raw: yes raw: yes
command: ./play.sh

9
play.sh Executable file
View File

@ -0,0 +1,9 @@
#! /bin/bash
PLAYDIR=./current
mkdir -p "$PLAYDIR"
ln "$1" "$PLAYDIR/$(basename "$1")"
ln "$1" "$PLAYDIR/play"
caddy file-server --listen :9000 --browse --root "$PLAYDIR"
rm "$PLAYDIR"/*