Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Initial docker support #103

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ utils/test
*node_modules/
.idea
*.egg-info

.cache
.pedalboards/
9 changes: 9 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,12 @@ And now you are ready to start the webserver::

Setting the environment variables is needed when developing on a PC.
Open your browser and point to http://localhost:8888/.

Docker
------

You can also use the docker to start an environment. First set the user and group in the `docker-compose`, then::

$ docker-compose up

Open your browser and point to http://localhost:8888/.
17 changes: 17 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: "3.7"

services:
mod-ui:
build:
context: ./
dockerfile: docker/Dockerfile
args:
UID: 1000
GID: 1000
environment:
- MOD_DEV_HOST=1
- MOD_DEV_ENVIRONMENT=0
volumes:
- ./:/home/modui
ports:
- 8888:8888
23 changes: 23 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM debian:10

MAINTAINER Mod Devices

ARG USER=modui
ARG GROUP=modui
ARG UID=1000
ARG GID=1000

ENV DEBIAN_FRONTEND noninteractive

RUN apt-get -y update \
&& apt-get -y install --no-install-recommends python3-pip python3-dev python3-venv python3-setuptools git build-essential libasound2-dev libjack-jackd2-dev liblilv-dev libjpeg-dev zlib1g-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/man/?? /usr/share/man/??_*

RUN groupadd -g ${GID} ${GROUP} \
&& useradd -m ${USER} --uid=${UID} --gid=${GID}
USER ${UID}:${GID}

WORKDIR /home/modui

CMD /bin/bash ./docker/entrypoint.sh
10 changes: 10 additions & 0 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
echo ':: Installing python dependencies'
python3 -m venv modui-env
source modui-env/bin/activate
pip3 install -r requirements.txt

echo ':: Compiling c utils'
make -C utils

echo ':: Starting server'
python3 ./server.py