-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add demonstration of MariaDB repo integration
Other parts of the environment are temporary.
- Loading branch information
Showing
2 changed files
with
105 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| # | ||
| # Just a demonstration of how to flexibly use MariaDB running in a separate container. | ||
| # It requires v3.9devel-269-gbdd3017 or later. | ||
| # | ||
| # Features: | ||
| # - see docker-compose.yml | ||
| # | ||
| # Limitations (will be resolved): | ||
| # - image is derived from Evolveum's dockerization | ||
| # - mariadb uses default database of 'registry' and default user of 'root' | ||
| # - JDBC password is present as plaintext | ||
| # | ||
| # Building: (assumes midpoint-3.9-SNAPSHOT-dist.tar.gz is present in the current directory) | ||
| # | ||
| # docker build -t midpoint . | ||
| # docker stack deploy -c docker-compose.yml mp | ||
| # | ||
|
|
||
| FROM openjdk:8-jdk-alpine | ||
|
|
||
| MAINTAINER info@evolveum.com | ||
|
|
||
| ARG MP_VERSION=3.9-SNAPSHOT | ||
| ARG MP_DIST_FILE=midpoint-${MP_VERSION}-dist.tar.gz | ||
|
|
||
| ENV MP_DIR /opt/midpoint | ||
| ENV REPO_HOST mariadb | ||
| ENV REPO_PORT 3306 | ||
| ENV REPO_USER root | ||
| ENV REPO_PASSWORD 123321 | ||
|
|
||
| RUN mkdir -p ${MP_DIR}/var | ||
|
|
||
| COPY ${MP_DIST_FILE} ${MP_DIR} | ||
|
|
||
| RUN echo 'Extracting midPoint archive...' \ | ||
| && tar xzf ${MP_DIR}/midpoint-${MP_VERSION}-dist.tar.gz -C ${MP_DIR} --strip-components=1 | ||
|
|
||
| VOLUME ${MP_DIR}/var | ||
|
|
||
| CMD java -Xmx2048M -Xms2048M -Dfile.encoding=UTF8 \ | ||
| -Dmidpoint.home=$MP_DIR/var \ | ||
| -Dmidpoint.repository.database=mariadb \ | ||
| -Dmidpoint.repository.jdbcUsername=$REPO_USER \ | ||
| -Dmidpoint.repository.jdbcPassword=$REPO_PASSWORD \ | ||
| -Dmidpoint.repository.jdbcUrl=jdbc:mariadb://$REPO_HOST:$REPO_PORT/registry?characterEncoding=utf8 \ | ||
| -Dmidpoint.repository.hibernateHbm2ddl=none \ | ||
| -Dmidpoint.repository.missingSchemaAction=create \ | ||
| -Dmidpoint.repository.initializationFailTimeout=60000 \ | ||
| -jar $MP_DIR/lib/midpoint.war |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| # | ||
| # Composition of midPoint and TIER MariaDB containers. | ||
| # | ||
| # MariaDB serves as a repository for midPoint. | ||
| # | ||
| # Features: | ||
| # - a separate volume for repository data (MySQL database directory), so it persists between creation/removal cycle of this stack | ||
| # - a separate volume for midPoint home directory, containing config.xml, logs, generated encryption keys, and so on | ||
| # | ||
|
|
||
| version: "3" | ||
| services: | ||
|
|
||
| mariadb: | ||
| image: tier/mariadb:mariadb10 | ||
| deploy: | ||
| restart_policy: | ||
| condition: none | ||
| volumes: | ||
| - repo-db-data:/var/lib/mysqlmounted | ||
| networks: | ||
| - webnet | ||
|
|
||
| mariadbadminer: | ||
| image: adminer | ||
| deploy: | ||
| restart_policy: | ||
| condition: none | ||
| depends_on: | ||
| - mariadb | ||
| ports: | ||
| - 18080:8080 | ||
| networks: | ||
| - webnet | ||
|
|
||
| midpoint: | ||
| image: midpoint | ||
| deploy: | ||
| restart_policy: | ||
| condition: none | ||
| depends_on: | ||
| - mariadb | ||
| ports: | ||
| - 8080:8080 | ||
| volumes: | ||
| - midpoint-home:/opt/midpoint/var # change this if MP_DIR changes | ||
| networks: | ||
| - webnet | ||
|
|
||
| networks: | ||
| webnet: | ||
|
|
||
| volumes: | ||
| repo-db-data: | ||
| midpoint-home: |