Commit a1b6b8af authored by David Trattnig's avatar David Trattnig
Browse files

Docker image for engine. #17

parent 6698d0b5
.travis.yaml
.swagger-codegen-ignore
README.md
tox.ini
git_push.sh
test-requirements.txt
setup.py
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/
venv/
.python-version
# Translations
*.mo
*.pot
# Django stuff:
*.log
# Sphinx documentation
docs/_build/
# PyBuilder
target/
#Ipython Notebook
.ipynb_checkpoints
# VirtualEnv
python
#Testing
.noseids
# Configurations
config/engine.ini
config/docker/engine.ini
env.list
......@@ -7,4 +7,7 @@ tmp
configuration/engine.ini
script/.engine.install-db.lock
.engine.install-db.lock
configuration/systemd/dev/
\ No newline at end of file
configuration/systemd/dev/
env.list
audio/source
configuration/docker/engine.ini
......@@ -3,24 +3,22 @@ FROM ocaml/opam2:debian-10
LABEL maintainer="David Trattnig <david.trattnig@subsquare.at>"
USER root
# Engine System Dependencies
RUN apt-get update && sudo apt-get -y install \
RUN sudo apt-get update && sudo apt-get -y install \
apt-utils \
redis-server \
libsndfile1 \
ffmpeg \
quelcom \
python3-pip \
python-dev \
python3 \
python3-pip \
build-essential \
libmariadbclient-dev \
default-libmysqlclient-dev
# Liquidsoap System Dependencies
RUN apt-get install -qq -yy \
RUN sudo apt-get install -qq -yy \
libasound2-dev \
libflac-dev \
libjack-dev \
......@@ -37,51 +35,36 @@ RUN apt-get install -qq -yy \
m4 \
pkg-config
# Create Users
# Update OPAM
RUN set -ex \
&& adduser --home /srv --no-create-home --system --uid 1001 --group engineuser \
&& adduser engineuser audio \
&& adduser engineuser opam
RUN opam init --disable-sandboxing -y
RUN opam switch create 4.08.0
RUN opam update -y
RUN opam install depext -y
# Initialize the project structure
# Liquidsoap Dependencies
RUN mkdir -p /srv
RUN mkdir -p /var/log/aura
COPY . /srv
RUN opam depext taglib mad lame vorbis flac opus cry samplerate pulseaudio bjack alsa ssl liquidsoap -y
RUN opam install taglib mad lame vorbis flac opus cry samplerate pulseaudio bjack alsa ssl liquidsoap -y
# 0wn'd
# Print Debug Information
RUN chown -R engineuser:engineuser /srv
RUN chown -R engineuser:engineuser /var/log/aura
RUN chown -R engineuser:engineuser /home/opam
RUN echo $(python3 -V)
RUN echo $(python3.7 -V)
RUN echo $(ls /home/opam/.opam/4.08.0/bin/liquidsoap)
#
# ENGINE INSTALLATION
#
# Setup Engine
USER engineuser
RUN mkdir -p /srv
RUN mkdir -p /home/opam/audio
RUN mkdir -p /home/opam/audio/source
COPY . /srv
WORKDIR /srv
ENV PATH="/home/opam/.local/bin:${PATH}"
# Python Package Installation
COPY requirements.txt /tmp/requirements.txt
RUN pip3 install -r /tmp/requirements.txt
# Default configuration
RUN sudo usermod -a -G audio opam
RUN python3.7 $(which pip3) install -r requirements.txt
COPY configuration/sample-docker.engine.ini /srv/configuration/engine.ini
# Update OPAM
# Start the Engine
RUN opam init --disable-sandboxing -y
RUN opam switch create 4.08.0
RUN opam update -y
RUN opam install depext -y
# Liquidsoap Dependencies
RUN opam depext taglib mad lame vorbis flac opus cry samplerate pulseaudio bjack alsa ssl liquidsoap -y
RUN opam install taglib mad lame vorbis flac opus cry samplerate pulseaudio bjack alsa ssl liquidsoap -y
RUN eval $(opam env)
ENTRYPOINT ["./run.sh"]
......@@ -22,7 +22,7 @@ redis_port=6379
redis_db=0
[monitoring]
mail_server=""
mail_server="mail.example.com"
mail_server_port="587"
mail_user="aura@subsquare.at"
mail_pass="---SECRET--PASSWORD---"
......
......@@ -13,16 +13,16 @@ station_logo_size="180px"
db_user="aura"
db_name="aura_engine"
db_pass="---SECRET--PASSWORD---"
db_host="localhost"
db_host="127.0.0.1"
db_charset="utf8"
[redis]
redis_host="172.17.0.1"
redis_host="127.0.0.1"
redis_port=6379
redis_db=0
[monitoring]
mail_server="w00fdabd.kasserver.com"
mail_server="mail.example.com"
mail_server_port="587"
mail_user="aura@subsquare.at"
mail_pass="---SECRET--PASSWORD---"
......@@ -39,7 +39,7 @@ heartbeat_port = 43334
# Seconds how often the vitality of the Engine should be checked (0 = disabled)
heartbeat_frequency = 1
logdir="/var/log/aura"
logdir="/srv/logs"
# Possible values: debug, info, warning, error, critical
loglevel="info"
......@@ -122,7 +122,7 @@ fade_out_time="2.5"
# all these settings from here to the bottom require a restart of the liquidsoap server
[lqs]
liquidsoap_path="/home/engineuser/.opam/4.08.0/bin/liquidsoap"
liquidsoap_path="/home/opam/.opam/4.08.0/bin/liquidsoap"
liquidsoap_working_dir="modules/liquidsoap/"
# Liquidsoap execution delay in seconds; Crucial to keep things in sync
......@@ -134,10 +134,10 @@ daemongroup="engineuser"
daemonuser="engineuser"
[socket]
socketdir="/opt/aura/engine/modules/liquidsoap"
socketdir="/srv/modules/liquidsoap"
[audiofolder]
audiofolder="/var/audio"
audiofolder="/home/opam/audio/source"
[fallback]
# track_sensitive => fallback_folder track sensitivity
......
......@@ -22,7 +22,7 @@ redis_port=6379
redis_db=0
[monitoring]
mail_server="w00fdabd.kasserver.com"
mail_server="mail.example.com"
mail_server_port="587"
mail_user="aura@subsquare.at"
mail_pass="---SECRET--PASSWORD---"
......
sqlalchemy==1.3.13
Flask==1.1.1
Flask-SQLAlchemy==2.4.1
requests==2.24.0
sqlalchemy==1.3.17
Flask==1.1.2
Flask_SQLAlchemy==2.4.3
mysqlclient==1.3.12
redis==3.5.3
mutagen==1.44.0
validators==0.12.1
accessify==0.3.1
pyyaml==5.3.1
\ No newline at end of file
accessify==0.3.1
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment