Versionen im Vergleich

Schlüssel

  • Diese Zeile wurde hinzugefügt.
  • Diese Zeile wurde entfernt.
  • Formatierung wurde geändert.

It is not always necessary to manually install the UM with the described installation method. In some cases it makes sense to run the UM in a docker container:

  • If you already have a dockerized application infrastructure

  • To develop CSE based applications in a local UM instance

Info

This section describes how you can create a customized UM Docker image.

We do not provide pre-built docker images because

  • years of practice have shown that setting up a UM instance usually involves customizing it in many ways and touching and adding a lot of files. That means, you would have to ADD or COPY a lot of files anyway.

  • While configuration variables (“cmsbs.properties”) can be passed via environment variables, there are a number of situations where whole files need to be added to the image: i.e. the licence file, sender and reply-to addresses, additions or modifications to the data model, optional UM Apps or custom CSE code.

  • Often times there will be more than just one single UM instance, so there is the need to end up with three or sometimes even more slightly different setups and thus different images.

  • The more customizing needs to be done, the more it makes sense to be able to first implement and test these customizations on your local machine and let the docker image create when you are done.

  • There is a tool that is desiged to do exactly that: The UM Kickstarter.

Creating a customized docker image

...

Next, copy your personal license file to env/devel/cmsbs-conf/cmsbs.license.If you project does not have a Dockerfile, you can create it via:

Codeblock
gradle dockerize

You are now ready to create your custom UM docker image:

Codeblock
languagebash
gradle dockerimage -Penv=devel

Running a UM from a custom docker image

Start your dockerized UM:

Codeblock
languagebash
docker run --rm --network host \
    -e UM_ADMIN_USERNAME=admin -e UM_ADMIN_PASSWORD=admin \
    myproject:devel

Go to http://localhost:8080/cmsbs and login as admin / admin.

...

There is quite a number of supported database engines to choose from (see Installation Requirements for a list of officially supported databases).

...

Codeblock
gradle dockerimage -Penv=devel

docker run --rm --network host \
    -e 'UM_ADMIN_USERNAME=admin' -e 'UM_ADMIN_PASSWORD=admin' \
    myproject:devel

The UM instance running on http://localhost:8080/cmsbs should now populate and use the new database.

...

The following represents a subset of the supported databases for which there are easy to use docker images available on docker hub:.

Each subsection contains a docker run command to start the according database listening on its respective standard TCP port and a docker run command to start a UM instance using that very database.

Postgres 12.3

Run Postgres on localhost:5432:

...

Codeblock
cmsbs.database.url      = "jdbc:postgresql://localhost:5432/"
cmsbs.database.user     = "postgres"
cmsbs.database.password = "mysecretpassword"

Alternatively, inject database settings via environment variables:

Codeblock
languagebash
docker run --rm --network host \
    -e 'UM_ADMIN_USERNAME=admin' -e 'UM_ADMIN_PASSWORD=admin' \
    -e 'cmsbs.database.url=jdbc:postgresql://localhost:5432/' \
    -e 'cmsbs.database.user=postgres' \
    -e 'cmsbs.database.password=mysecretpassword' \
    myproject:devel

JDBC Driver: https://jdbc.postgresql.org/download

...

Codeblock
cmsbs.database.url      = "jdbc:mysql://localhost:3306/um?allowPublicKeyRetrieval=true"
cmsbs.database.user     = "root"
cmsbs.database.password = "secret"
cmsbs.database.mysql.Unicode = true

Alternatively, inject database settings via environment variables:

Codeblock
languagebash
docker run --rm --network host \
    -e 'UM_ADMIN_USERNAME=admin' -e 'UM_ADMIN_PASSWORD=admin' \
    -e 'cmsbs.database.url=jdbc:mysql://localhost:3306/um?allowPublicKeyRetrieval=true' \
    -e 'cmsbs.database.user=root' \
    -e 'cmsbs.database.password=secret' \
    myproject:devel

JDBC Driver: https://dev.mysql.com/downloads/connector/j/

...

Codeblock
cmsbs.database.url      = "jdbc:mysql://localhost:3306/um?allowPublicKeyRetrieval=true"
cmsbs.database.user     = "um"
cmsbs.database.password = "secret"
cmsbs.database.mysql.Unicode = true

Alternatively, inject database settings via environment variables:

Codeblock
languagebash
docker run --rm --network host \
    -e 'UM_ADMIN_USERNAME=admin' -e 'UM_ADMIN_PASSWORD=admin' \
    -e 'cmsbs.database.url=jdbc:mysql://localhost:3306/um?allowPublicKeyRetrieval=true' \
    -e 'cmsbs.database.user=um' \
    -e 'cmsbs.database.password=secret' \
    myproject:devel

JDBC Driver: https://dev.mysql.com/downloads/connector/j/

MSSQL

...

2022

Run MSSQL on localhost:1433:

Codeblock
docker run \
    -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=S3cre7pw' -e 'MSSQL_PID=Express' \
    -p 1433:1433 \
    --name mssql2017 \
    mcr.microsoft.com/mssql/server:20172022-latest-ubuntu

UM configuration:

Codeblock
cmsbs.database.url      = "jdbc:sqlserver://localhost:1433;trustServerCertificate=true"
cmsbs.database.user     = "sa"
cmsbs.database.password = "S3cre7pw"
cmsbs.database.mssql.Unicode = true

Alternatively, inject database settings via environment variables:

Codeblock
languagebash
docker run --rm --network host \
    -e 'UM_ADMIN_USERNAME=admin' -e 'UM_ADMIN_PASSWORD=admin' \
    -e 'cmsbs.database.url=jdbc:sqlserver://localhost:1433;trustServerCertificate=true' \
    -e 'cmsbs.database.user=sa' \
    -e 'cmsbs.database.password=S3cre7pw' \
    myproject:devel

JDBC Driver: https://docs.microsoft.com/en-us/sql/connect/jdbc/download-microsoft-jdbc-driver-for-sql-server?view=sql-server-ver15

Oracle 11g

Run Oracle on localhost:1521:

...

Codeblock
cmsbs.database.url      = "jdbc:oracle:thin:@localhost:1521:xe"
cmsbs.database.user     = "system"
cmsbs.database.password = "oracle"

Alternatively, inject database settings via environment variables:

Codeblock
languagebash
docker run --rm --network host \
    -e 'UM_ADMIN_USERNAME=admin' -e 'UM_ADMIN_PASSWORD=admin' \
    -e 'cmsbs.database.url=jdbc:oracle:thin:@localhost:1521:xe' \
    -e 'cmsbs.database.user=system' \
    -e 'cmsbs.database.password=oracle' \
    myproject:devel

JDBC Driver: https://www.oracle.com/database/technologies/appdev/jdbc-downloads.html (Oracle account required!)

...