From: marcelveldt Date: Thu, 16 May 2019 14:40:04 +0000 (+0200) Subject: fixed docker config X-Git-Url: https://git.kitaultman.com/?a=commitdiff_plain;h=8920c06258a9b19fde105b7688644553664dd53c;p=music-assistant-server.git fixed docker config --- diff --git a/Dockerfile b/Dockerfile index cf37ea7d..cd282f7c 100755 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM python:3.7.3-alpine # install deps -RUN apk add build-base python-dev flac sox taglib-dev +RUN apk add build-base python-dev flac sox taglib-dev zip curl COPY requirements.txt requirements.txt RUN pip install --upgrade -r requirements.txt @@ -13,4 +13,9 @@ RUN chmod a+x /usr/src/app/main.py VOLUME ["/data"] -CMD ["python3.7", "/usr/src/app/main.py", "/data"] \ No newline at end of file +COPY run.sh /run.sh +RUN chmod +x /run.sh + +ENV autoupdate false + +CMD ["/run.sh"] \ No newline at end of file diff --git a/run.sh b/run.sh new file mode 100755 index 00000000..993dbc3e --- /dev/null +++ b/run.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# auto update to latest git version if update environmental variable is set +if [ "$autoupdate" == "true" ]; then + echo "Auto updating to latest (unstable) git version!" + cd /tmp + curl -LOks "https://github.com/marcelveldt/musicassistant/archive/master.zip" + unzip -q master.zip + pip install -q --upgrade -r musicassistant-master/requirements.txt + cp -rf musicassistant-master/music_assistant/. /usr/src/app + rm -R /tmp/musicassistant-master +fi + +# run program +cd /usr/src/app +exec python3 /usr/src/app/main.py /data > /proc/1/fd/1 2>/proc/1/fd/2 \ No newline at end of file