diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..dc62615337a55561fb5d26eb5f5f5390f92f6b7d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +FROM python:3.6.9-stretch + +MAINTAINER Gottfried Gaisbauer <gottfried.gaisbauer@servus.at> + +RUN set -ex \ + && rm -f /usr/bin/python && ln -s /usr/local/bin/python /usr/bin/python \ + && rm -f /usr/bin/python3 && ln -s /usr/local/bin/python3 /usr/bin/python3 + +RUN set -ex \ + && apt-get update -q \ + && apt-get install -y -q --no-install-recommends libev4 libev-dev \ + liquidsoap liquidsoap-plugin-alsa liquidsoap-plugin-icecast liquidsoap-plugin-jack liquidsoap-plugin-pulseaudio \ + liquidsoap-plugin-flac liquidsoap-plugin-lame liquidsoap-plugin-mad liquidsoap-plugin-ogg liquidsoap-plugin-opus liquidsoap-plugin-faad \ + liquidsoap-plugin-taglib \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +COPY requirements.txt /tmp/requirements.txt + +RUN pip3 install -r /tmp/requirements.txt + +RUN set -ex \ + && adduser --home /srv --no-create-home --system --uid 1000 --group app \ + && adduser app audio diff --git a/build.sh b/build.sh new file mode 100755 index 0000000000000000000000000000000000000000..9085f413719622c7c069b22a5781f0f2039aa296 --- /dev/null +++ b/build.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +exec sudo docker build -t aura/engine . diff --git a/configuration/sample-production.engine.ini b/configuration/sample-production.engine.ini index e22431e963a88258ad4cfe4f4f95889bb52bf9c3..2355c305291595ebdb0f375effe8940997f31c75 100644 --- a/configuration/sample-production.engine.ini +++ b/configuration/sample-production.engine.ini @@ -17,7 +17,7 @@ db_host="localhost" db_charset="utf8" [redis] -redis_host="localhost" +redis_host="172.17.0.1" redis_port=6379 redis_db=0 diff --git a/prepare.sh b/prepare.sh new file mode 100755 index 0000000000000000000000000000000000000000..4be35fcfadfb19557a9d828b5acfdb57f231620e --- /dev/null +++ b/prepare.sh @@ -0,0 +1,4 @@ +#!/bin/bash +BASE_D=$(realpath "${BASH_SOURCE%/*}/") + +exec sudo docker run --rm -it -u $UID:$GID -v "$BASE_D":/srv -v "$BASE_D/configuration/":/etc/aura --tmpfs /var/log/aura/ aura/engine /srv/initdb.py diff --git a/run_aura.sh b/run_aura.sh new file mode 100755 index 0000000000000000000000000000000000000000..11751cc4b5abec29103d43d09f758049765bfde2 --- /dev/null +++ b/run_aura.sh @@ -0,0 +1,4 @@ +#!/bin/bash +BASE_D=$(realpath "${BASH_SOURCE%/*}/") + +exec sudo docker run --name aura-engine --rm -it -u $UID:$GID -p 127.0.0.1:8050:5000 -v "$BASE_D":/srv -v "$BASE_D/configuration/":/etc/aura --tmpfs /var/log/aura/ aura/engine /srv/aura.py diff --git a/run_liquidsoap.sh b/run_liquidsoap.sh new file mode 100755 index 0000000000000000000000000000000000000000..88f92d2378febc318357f65636b19c5bf7e32ede --- /dev/null +++ b/run_liquidsoap.sh @@ -0,0 +1,4 @@ +#!/bin/bash +BASE_D=$(realpath "${BASH_SOURCE%/*}/") + +exec sudo docker run --name aura-engine-liquidsoap --rm -it -u 1000:1000 -v "$BASE_D":/srv -v "$BASE_D/configuration/":/etc/aura --tmpfs /var/log/aura/ --device /dev/snd aura/engine /bin/bash -c "cd /srv/modules/liquidsoap && liquidsoap --debug --verbose engine.liq"