diff --git a/.gitignore b/.gitignore index c9fea7225..33cee0f5d 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,6 @@ utils/test *node_modules/ .idea *.egg-info + +.cache +.pedalboards/ \ No newline at end of file diff --git a/README.rst b/README.rst index 8c9ac1da5..2f1a9cfb4 100644 --- a/README.rst +++ b/README.rst @@ -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/. \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..fcb490a0d --- /dev/null +++ b/docker-compose.yml @@ -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 \ No newline at end of file diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 000000000..e6dd53db0 --- /dev/null +++ b/docker/Dockerfile @@ -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 \ No newline at end of file diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh new file mode 100644 index 000000000..ed757ed19 --- /dev/null +++ b/docker/entrypoint.sh @@ -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