Sign inSign up

itsziget/dspace-tomcat

By itsziget

•Updated over 7 years ago

On-build base tomcat images for dspace production environment

Image
0

190

itsziget/dspace-tomcat repository overview

⁠DSpace Tomcat

Running DSpace inside docker containers can be tricky. This image helps you run each webapp in separate containers. In fact, you can decide which app you want to install; therefore you can still run each of them in the same container.

There are some currently supported applications, however, you are not limited to install only those.

Supported applications are:

  • oai
  • rest
  • solr
  • swordv2
  • xmlui

To build your own tomcat image, create a Dockerfile

FROM itsziget/dspace/dspace-builder:v1.0.0-rc.1 as builder

FROM itsziget/dspace/dspace-tomcat:v1.0.0-rc.1

and place the custom sourcecode into "srcCustom".

You can use the images from Docker Hub of course.

NOTE: "as builder" is important at the and of the first line. The second stage will copy the built files from the "builder" stage.

This way you can use any compatible builder and tomcat images.

⁠OnBuild arguments

  • APP_NAME: (default: "xmlui") It must have the same value as it was in the builder. It informs the tomcat builder and the running container's scripts which applications it needs to deal with. When you run the the container, those scripts try to modify only the installed applications' configurations based on the environment variables.
  • APP_ROOT: (default: "xmlui") It must contain only one application's name. It will be renamed to "ROOT" to make it web root.

⁠Customize the start process

You can change how the container starts. Copy the following files into the image or mount them into the container to do it:

  • /app/dspace/bin/custom/beforePrepare.sh: It will be executed before the built-in scripts.
  • /app/dspace/bin/custom/afterPrepare.sh: It will be executed after the built-in scripts.

⁠Prepare the database

The database will be installed automatically when xmlui starts if the database server is ready to accept connections.

Create the database user and database

createuser <USER> --pwprompt
createdb <DBNAME> --owner <USER>

Now install pgcrypto extension:

psql <DBNAME> -c 'create extension pgcrypto;'

⁠Custom configuration

There are environment variables to customize configurations like database connection and URL-s:

  • DS_PORT: (default: 8080) Public port of the XMLUI webinterface.
  • DS_DB_HOST: (default: "db") The host of the postgresql database server
  • DS_DB_PORT: (default: 5432) The port of the postgresql database server
  • DS_DB_SERVICE_NAME: (default: "dspace") The name of the postgresql database
  • DS_LOGLEVEL_OTHER: (default: "WARN") Value of loglevel.other in log4j.properties
  • DS_LOGLEVEL_DSPACE: (default: "WARN") Value of loglevel.dspace in log4j.properties
  • DS_PROTOCOL: (default: "http") Protocol of the XMLUI. https or http
  • DS_SOLR_HOSTNAME: (default: "solr") Internal hostname of solr server. It will always use http protocol.
  • DS_SOLR_ALLOW_REMOTE: (default: "false") If it is "true" solr can be accessible from anywhere. In this case you should use an external firewall/proxy to deny untrusted clients to connect.
  • DS_CUSTOM_CONFIG: (default: "") It is a multiline string for custom configurations that you could use in dspace.cfg
  • DS_REST_FORCE_SSL: (default: "true") The rest API requires secure connection by default. Using containers it can be unnecessary behind a secure proxy. You can turn it off by setting it to "false"
  • DS_REDIS_SESSION: (default: true) During an upgrade, you would lose all of the sessions without an external session database. However, if you do not wish to use Redis⁠, you can turn it off by setting the variable to "false". Currently, the redis server must be accessible as "redis". Docker lets you map custom hostnames to IP addresses. See docker run⁠ for more information.

Any configuration directive can be set using environment variables prefixed by "config.".

Example:

xmlui:
  environment:
    config.dspace.url: https://mydspace.tld:8080

The followings are set by default in each docker image:

  • config.dspace.ui: "xmlui"
  • config.dspace.url: "${dspace.baseUrl}"
  • config.handle.canonical.prefix: "${dspace.url}/handle/"
  • config.swordv2-server.url: "${dspace.url}/swordv2"
  • config.swordv2-server.servicedocument.url: "${swordv2-server.url}/servicedocument"

For more information see the GitHub repository⁠

Tag summary

Content type

Image

Digest

Size

83.7 MB

Last updated

over 7 years ago

docker pull itsziget/dspace-tomcat:v1.0.0-rc.1