tuub / kitodo-mediaserver

Kitodo Mediaserver
GNU General Public License v3.0
7 stars 6 forks source link

Add Docker support #109

Closed ponchofiesta closed 6 years ago

ponchofiesta commented 6 years ago

To give an easy start with an encapsulated environment we should provide a Docker image.

ponchofiesta commented 6 years ago

This also fixes #107 and #108

In the directory docker is everything you need to create a docker image and to run this docker image.

The build script build.sh allows you to build the image. Build the docker image using the official Docker Hub namespace and name tubub/kitodo-mediaserver:VERSION:

./build.sh -v 1.0-SNAPSHOT

The Mediaserver binaries are getting downloaded from the tuub/kitodo-mediaserver Github repo. So there needs to be a release with the same version. You may then push the docker image to Docker Hub by:

# login to Docker Hub (this requires a docker account with access to the tubub namespace)
docker login
# push the iamge to Docker Hub
docker push tubub/kitodo-mediaserver:VERSION

You can also build an image from your current Mediaserver source. First build the Mediaserver as usual and then run

./build.sh -s -v 1.0-SNAPSHOT

The image includes three environment variables:

# create the database tables
MS_CREATE_TABLES=1
# run the cron job to import new works
MS_SCHEDULER_IMPORT=1
# run the cron job to clean old derivative files
MS_SCHEDULER_CACHECLEAR=1

The image includes a wrapper script for the Mediaserver CLI. using docker-compose ou can call it using:

docker-compose exec mediaserver cli
# import example:
docker-compose exec mediaserver cli import

There is a docker-compose.yml which provides a sample startup configuration.

You should keep official Github releases in sync with the docker image releases.