fixed docker config
authormarcelveldt <marcelvanderveldt@MacBook-Pro.local>
Thu, 16 May 2019 14:40:04 +0000 (16:40 +0200)
committermarcelveldt <marcelvanderveldt@MacBook-Pro.local>
Thu, 16 May 2019 14:40:04 +0000 (16:40 +0200)
Dockerfile
run.sh [new file with mode: 0755]

index cf37ea7d3b52fc57f4045f50c483c54af27bfc7c..cd282f7c99c7c039c254b681a4d20bbe20689151 100755 (executable)
@@ -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 (executable)
index 0000000..993dbc3
--- /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