diff --git a/Dockerfile b/Dockerfile index 99e172b..27bb938 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,14 @@ 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 ./ RUN pip install -r ./requirements.txt @@ -7,7 +16,7 @@ RUN mkdir /beets VOLUME /beets ENV BEETSDIR=/beets -RUN apt-get update && apt-get install -y --no-install-recommends vim -ENV EDITOR=vim +COPY ./config.yaml ./ +COPY ./play.sh ./ ENTRYPOINT ["/usr/local/bin/beet"] diff --git a/config.yaml b/config.yaml index 72a5bdd..ba1ba67 100644 --- a/config.yaml +++ b/config.yaml @@ -47,3 +47,4 @@ duplicates: play: raw: yes + command: ./play.sh diff --git a/play.sh b/play.sh new file mode 100755 index 0000000..f84259c --- /dev/null +++ b/play.sh @@ -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"/* +