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

Docker #93

Open
wants to merge 2 commits 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
47 changes: 47 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
FROM debian:stable

RUN apt-get update

RUN apt-get install -y \
virtualenv \
python3-pip \
python3-dev \
git \
build-essential \
libasound2-dev \
libjack-jackd2-dev \
liblilv-dev \
libjpeg-dev \
zlib1g-dev \
python2


ENV LV2_PATH="/lv2"
ENV MOD_DEV_HOST=1
ENV MOD_DEV_ENVIRONMENT=0

RUN mkdir /mod-lv2-data
RUN mkdir /lv2
WORKDIR /mod-lv2-data
RUN git clone https://github.com/moddevices/mod-lv2-data.git
RUN mv mod-lv2-data/plugins-fixed/* /lv2
RUN rm -rf mod-lv2-data

RUN mkdir /mod-ui

COPY ./ /mod-ui/

WORKDIR /mod-ui

RUN virtualenv modui-env
RUN chmod a+x activate-env
RUN ./activate-env

RUN pip3 install -r requirements.txt
RUN make -C utils

EXPOSE 8888

VOLUME ["/lv2", "/mod-ui"]

CMD python3 ./server.py
43 changes: 42 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ It will work in x86, other Linux distributions and Mac, but you might need to ad

The following packages will be required::

$ sudo apt-get install virtualenv python3-pip python3-dev git build-essential libasound2-dev libjack-jackd2-dev liblilv-dev libjpeg-dev
$ sudo apt-get install virtualenv python3-pip python3-dev git build-essential libasound2-dev libjack-jackd2-dev liblilv-dev libjpeg-dev zlib1g-dev

NOTE: libjack-jackd2-dev can be replaced by libjack-dev if you are using JACK1; libjpeg-dev is needed for python-pillow, at least on my system.

Expand Down Expand Up @@ -58,3 +58,44 @@ 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/.

Running with docker
-------------------

You can also run mod-ui locally using docker.

Note that, with docker, mod-ui will run with fake connections to the host (there is no host). So no sound will be produced.

Run docker:

```
docker pull moddevices/mod-ui
docker run -p 8888:8888
```

Open your browser and point to http://localhost:8888/.

There are two volumes you can mount:
* /lv2 -> the folder containing all the lv2 plugins (by default, this image brings all plugins inside plugins-fixed folder in the mod-lv2-data repository)
* /mod-ui -> the MOD UI source code (this repository)

Using your own LV2 plugins
++++++++++++++++++++++++++

You can mount a volume to your LV2 plugins folder to be able to use them with the MOD UI.

```
docker run -p 8888:8888 -v /path-to-my-lv2-folder/lv2:/lv2 moddevices/mod-ui

```

Mounting the UI source code
+++++++++++++++++++++++++++

If you are developing the UI, you probably want to mount the source code from your machine into docker. Doing this, you can code on your environment and see the changes working on the server inside docker:

```
docker run -p 8888:8888 -v /path-to-your-clone-of-this-repo/mod-ui:/mod-ui moddevices/mod-ui

```

5 changes: 5 additions & 0 deletions activate-env
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

# This file is used by Dockerfile to ensure source is called from bash and not sh

source modui-env/bin/activate