Skip to content
Snippets Groups Projects
Commit a1b6b8af authored by David Trattnig's avatar David Trattnig
Browse files

Docker image for engine. #17

parent 6698d0b5
No related branches found
No related tags found
No related merge requests found
.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 ...@@ -7,4 +7,7 @@ tmp
configuration/engine.ini configuration/engine.ini
script/.engine.install-db.lock script/.engine.install-db.lock
.engine.install-db.lock .engine.install-db.lock
configuration/systemd/dev/ configuration/systemd/dev/
\ No newline at end of file env.list
audio/source
configuration/docker/engine.ini
...@@ -3,24 +3,22 @@ FROM ocaml/opam2:debian-10 ...@@ -3,24 +3,22 @@ FROM ocaml/opam2:debian-10
LABEL maintainer="David Trattnig <david.trattnig@subsquare.at>" LABEL maintainer="David Trattnig <david.trattnig@subsquare.at>"
USER root
# Engine System Dependencies # Engine System Dependencies
RUN apt-get update && sudo apt-get -y install \ RUN sudo apt-get update && sudo apt-get -y install \
apt-utils \ apt-utils \
redis-server \ redis-server \
libsndfile1 \
ffmpeg \ ffmpeg \
quelcom \ quelcom \
python3-pip \ python3 \
python-dev \ python3-pip \
build-essential \
libmariadbclient-dev \ libmariadbclient-dev \
default-libmysqlclient-dev default-libmysqlclient-dev
# Liquidsoap System Dependencies # Liquidsoap System Dependencies
RUN apt-get install -qq -yy \ RUN sudo apt-get install -qq -yy \
libasound2-dev \ libasound2-dev \
libflac-dev \ libflac-dev \
libjack-dev \ libjack-dev \
...@@ -37,51 +35,36 @@ RUN apt-get install -qq -yy \ ...@@ -37,51 +35,36 @@ RUN apt-get install -qq -yy \
m4 \ m4 \
pkg-config pkg-config
# Create Users # Update OPAM
RUN set -ex \ RUN opam init --disable-sandboxing -y
&& adduser --home /srv --no-create-home --system --uid 1001 --group engineuser \ RUN opam switch create 4.08.0
&& adduser engineuser audio \ RUN opam update -y
&& adduser engineuser opam RUN opam install depext -y
# Initialize the project structure # Liquidsoap Dependencies
RUN mkdir -p /srv RUN opam depext taglib mad lame vorbis flac opus cry samplerate pulseaudio bjack alsa ssl liquidsoap -y
RUN mkdir -p /var/log/aura RUN opam install taglib mad lame vorbis flac opus cry samplerate pulseaudio bjack alsa ssl liquidsoap -y
COPY . /srv
# 0wn'd # Print Debug Information
RUN chown -R engineuser:engineuser /srv RUN echo $(python3 -V)
RUN chown -R engineuser:engineuser /var/log/aura RUN echo $(python3.7 -V)
RUN chown -R engineuser:engineuser /home/opam RUN echo $(ls /home/opam/.opam/4.08.0/bin/liquidsoap)
# # Setup Engine
# ENGINE INSTALLATION
#
USER engineuser RUN mkdir -p /srv
RUN mkdir -p /home/opam/audio
RUN mkdir -p /home/opam/audio/source
COPY . /srv
WORKDIR /srv WORKDIR /srv
ENV PATH="/home/opam/.local/bin:${PATH}" ENV PATH="/home/opam/.local/bin:${PATH}"
RUN sudo usermod -a -G audio opam
# Python Package Installation RUN python3.7 $(which pip3) install -r requirements.txt
COPY requirements.txt /tmp/requirements.txt
RUN pip3 install -r /tmp/requirements.txt
# Default configuration
COPY configuration/sample-docker.engine.ini /srv/configuration/engine.ini COPY configuration/sample-docker.engine.ini /srv/configuration/engine.ini
# Update OPAM # Start the Engine
RUN opam init --disable-sandboxing -y ENTRYPOINT ["./run.sh"]
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)
...@@ -22,7 +22,7 @@ redis_port=6379 ...@@ -22,7 +22,7 @@ redis_port=6379
redis_db=0 redis_db=0
[monitoring] [monitoring]
mail_server="" mail_server="mail.example.com"
mail_server_port="587" mail_server_port="587"
mail_user="aura@subsquare.at" mail_user="aura@subsquare.at"
mail_pass="---SECRET--PASSWORD---" mail_pass="---SECRET--PASSWORD---"
......
...@@ -13,16 +13,16 @@ station_logo_size="180px" ...@@ -13,16 +13,16 @@ station_logo_size="180px"
db_user="aura" db_user="aura"
db_name="aura_engine" db_name="aura_engine"
db_pass="---SECRET--PASSWORD---" db_pass="---SECRET--PASSWORD---"
db_host="localhost" db_host="127.0.0.1"
db_charset="utf8" db_charset="utf8"
[redis] [redis]
redis_host="172.17.0.1" redis_host="127.0.0.1"
redis_port=6379 redis_port=6379
redis_db=0 redis_db=0
[monitoring] [monitoring]
mail_server="w00fdabd.kasserver.com" mail_server="mail.example.com"
mail_server_port="587" mail_server_port="587"
mail_user="aura@subsquare.at" mail_user="aura@subsquare.at"
mail_pass="---SECRET--PASSWORD---" mail_pass="---SECRET--PASSWORD---"
...@@ -39,7 +39,7 @@ heartbeat_port = 43334 ...@@ -39,7 +39,7 @@ heartbeat_port = 43334
# Seconds how often the vitality of the Engine should be checked (0 = disabled) # Seconds how often the vitality of the Engine should be checked (0 = disabled)
heartbeat_frequency = 1 heartbeat_frequency = 1
logdir="/var/log/aura" logdir="/srv/logs"
# Possible values: debug, info, warning, error, critical # Possible values: debug, info, warning, error, critical
loglevel="info" loglevel="info"
...@@ -122,7 +122,7 @@ fade_out_time="2.5" ...@@ -122,7 +122,7 @@ fade_out_time="2.5"
# all these settings from here to the bottom require a restart of the liquidsoap server # all these settings from here to the bottom require a restart of the liquidsoap server
[lqs] [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_working_dir="modules/liquidsoap/"
# Liquidsoap execution delay in seconds; Crucial to keep things in sync # Liquidsoap execution delay in seconds; Crucial to keep things in sync
...@@ -134,10 +134,10 @@ daemongroup="engineuser" ...@@ -134,10 +134,10 @@ daemongroup="engineuser"
daemonuser="engineuser" daemonuser="engineuser"
[socket] [socket]
socketdir="/opt/aura/engine/modules/liquidsoap" socketdir="/srv/modules/liquidsoap"
[audiofolder] [audiofolder]
audiofolder="/var/audio" audiofolder="/home/opam/audio/source"
[fallback] [fallback]
# track_sensitive => fallback_folder track sensitivity # track_sensitive => fallback_folder track sensitivity
......
...@@ -22,7 +22,7 @@ redis_port=6379 ...@@ -22,7 +22,7 @@ redis_port=6379
redis_db=0 redis_db=0
[monitoring] [monitoring]
mail_server="w00fdabd.kasserver.com" mail_server="mail.example.com"
mail_server_port="587" mail_server_port="587"
mail_user="aura@subsquare.at" mail_user="aura@subsquare.at"
mail_pass="---SECRET--PASSWORD---" mail_pass="---SECRET--PASSWORD---"
......
sqlalchemy==1.3.13 requests==2.24.0
Flask==1.1.1 sqlalchemy==1.3.17
Flask-SQLAlchemy==2.4.1 Flask==1.1.2
Flask_SQLAlchemy==2.4.3
mysqlclient==1.3.12 mysqlclient==1.3.12
redis==3.5.3 redis==3.5.3
mutagen==1.44.0
validators==0.12.1 validators==0.12.1
accessify==0.3.1 accessify==0.3.1
pyyaml==5.3.1 \ No newline at end of file
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment