Skip to content

SEPIA inside virtual environments

SEPIA Open Assistant edited this page Feb 22, 2020 · 15 revisions

SEPIA inside a Docker Container

When running SEPIA-Home inside a Docker container there are a few things you need to take care of to make the system stable and to make data persistent.

Get your container

You can pull pre-built containers from Docker Hub: https://hub.docker.com/repository/docker/sepia/home

Set up your host system properly

The Docker container will inherit certain properties of your host system (the machine running Docker). One of these properties is about virtual memory (mmap counts) and is important for the Elasticsearch database used by SEPIA.
Usually you would set sudo sysctl -w vm.max_map_count=262144 in your Linux system before running Elasticsearch, but this will not work inside Docker. You need to run the command BEFORE starting your container.

On some systems like Windows and Mac you probably need to enter the virtual machine first that runs the Docker engine. Try one of these commands:

  • Windows / Docker Toolbox: docker-machine ssh
  • Mac (xhyve virtual machine): screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty

Inside this machine enter sudo sysctl -w vm.max_map_count=262144.

Create a shared volume

Your SEPIA-Home installation needs to have a place to store data persistently. The most comfortable solution is to create an EMPTY(!) Docker volume in advance and add this to your run script. This way the Docker container will itself copy over all necessary data to the empty volume on start. Here is how this works (Linux, may or may not require sudo):

SEPIA_SHARE=/home/[my-user]/sepia-home-share && mkdir -p $SEPIA_SHARE"
docker volume create --opt type=none --opt device=$SEPIA_SHARE --opt o=bind sepia-home-share"`

On Windows you might need to do some additional configuration via the 'shared drives' configuration of the Docker settings. Maybe there is something similar for Mac (not tested yet).

Run SEPIA-Home setup on first start

Before you can use your SEPIA-Home server you need to run the setup to create your database and define passwords for the admin and assistant user. Use the following command to run your container with terminal access (replace X.Y.Z with your version):

docker run --rm --name=sepia_home -it -v sepia-home-share:/home/admin/SEPIA sepia/home:vX.Y.Z /bin/bash"

Inside your container terminal type bash setup.sh and complete the setup with steps 4 and 1. After that exit the container.

Default run command

The default run command for your SEPIA container should make available some port to access the SEPIA server (recommended 20726 but can be anything) and mount your volume (above we called it 'sepia-home-share'):

docker run --rm --name=sepia_home -p 20726:20726 -v sepia-home-share:/home/admin/SEPIA sepia/home:vX.Y.Z"

(may or may not require sudo, depending on your setup)

Clone this wiki locally