Skip to content

Commit

Permalink
Add guidelines for running Saraswati on Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed Jun 21, 2021
1 parent eb5a7c8 commit e35a704
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*

!saraswati
!setup.py
!LICENSE
!README.rst
!CHANGES.rst
!MANIFEST.in
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Saraswati changelog
in progress
===========

- Add guidelines for running Saraswati on Docker


2021-06-21 0.3.0
================
Expand Down
13 changes: 13 additions & 0 deletions doc/setup-sandbox.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,16 @@ Clone source repository

# Invoke test suite
make test


Using Docker for development
============================

This will give you a Linux environment, even on non-Linux workstations.

::

docker build --file=dockerfiles/develop.Dockerfile --tag=saraswati-develop .
docker run -it --rm --volume=$PWD:/src saraswati-develop bash
pip3 install --editable=/src
saraswati record --channel="testdrive source=audiotestsrc wave=3 freq=200"
13 changes: 13 additions & 0 deletions dockerfiles/develop.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Docker build file for Saraswati development.
#
# Invoke like:
#
# docker build --file=dockerfiles/develop.Dockerfile --tag=saraswati-develop .
#
FROM amd64/debian:bullseye-slim

RUN apt-get update && \
apt-get install --yes \
libgstreamer1.0 gstreamer1.0-tools gstreamer1.0-alsa gstreamer1.0-plugins-base gstreamer1.0-plugins-good \
python3 python3-pip python3-gst-1.0 python3-gi python3-tz \
alsa-utils mkvtoolnix flac wavpack
30 changes: 30 additions & 0 deletions dockerfiles/runtime.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Docker build file for Saraswati runtime.
#
# Invoke like:
#
# docker build --file=dockerfiles/runtime.Dockerfile --tag=saraswati-runtime .
#
FROM amd64/debian:bullseye-slim

RUN apt-get update && \
apt-get install --yes \
libgstreamer1.0 gstreamer1.0-tools gstreamer1.0-alsa gstreamer1.0-plugins-base gstreamer1.0-plugins-good \
python3 python3-pip python3-gst-1.0 python3-gi python3-tz \
alsa-utils mkvtoolnix flac wavpack

# Create /etc/saraswati
RUN mkdir -p /etc/saraswati

# Add user "saraswati"
RUN groupadd -r saraswati && useradd -r -g saraswati saraswati
RUN chown -R saraswati:saraswati /etc/saraswati

# Install saraswati
COPY . /src
RUN pip install /src

# Make process run as "saraswati" user
USER saraswati

# Invoke program
CMD saraswati

0 comments on commit e35a704

Please sign in to comment.