Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/shibboleth-integrat…
Browse files Browse the repository at this point in the history
…ion' into shibboleth-integration
  • Loading branch information
skublik committed Sep 20, 2018
2 parents 22a97b1 + 178aa91 commit 8dedf79
Show file tree
Hide file tree
Showing 6 changed files with 133 additions and 7 deletions.
23 changes: 23 additions & 0 deletions demo/postgresql/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: "3.3"

services:
postgresql:
build: ./postgresql/
environment:
- POSTGRES_PASSWORD=password
expose:
- 5432
ports:
- 5432:5432
networks:
- net
volumes:
- data:/var/lib/postgresql/data


networks:
net:
driver: bridge

volumes:
data:
45 changes: 45 additions & 0 deletions demo/postgresql/midpoint-additions-for-standalone-run.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#
# This is a file with additions to ../midpoint/docker-compose.yml file, to be used in the following way:
#
# (in this directory)
#
# $ docker-compose up --build
#
# (in ../midpoint directory)
#
# $ docker-compose -f docker-compose.yml -f ../demo/postgresql/midpoint-additions-for-standalone-run.yml up --build
#
# It expects that PostgreSQL is started independently of midPoint. When executing the containers in this way, there are two compositions with the following containers:
#
# "midpoint"
#
# 1) midpoint-server
# 2) midpoint-data <-- this is the original MariaDB container; it will execute command of 'true' i.e. exiting just upon the startup
#
# "postgresql"
#
# 1) postgresql
#

version: "3.3"

services:
midpoint-server:
environment:
- REPO_DATABASE_TYPE=postgresql
- REPO_HOST=postgresql
- REPO_PORT=5432
- REPO_DATABASE=midpoint
- REPO_USER=midpoint
networks:
- postgresql_net

# effectively disable original MariaDB service
midpoint-data:
image: alpine:latest
command: "true"
entrypoint: "true"

networks:
postgresql_net:
external: true
47 changes: 47 additions & 0 deletions demo/postgresql/midpoint-additions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#
# This is a file with additions to ../midpoint/docker-compose.yml file, to be used in the following way:
#
# (in ../midpoint directory)
#
# $ docker-compose -f docker-compose.yml -f ../demo/postgresql/midpoint-additions.yml up --build
#
# It expects that PostgreSQL is started as part of midPoint composition. So there will be three containers there:
#
# 1) midpoint-server
# 2) postgresql
# 3) midpoint-data <-- this is the original MariaDB container; it will execute command of 'true' i.e. exiting just upon the startup
#

version: "3.3"

services:
postgresql:
build: ../demo/postgresql/postgresql/
entrypoint: ["/docker-entrypoint.sh", "postgres"] # for some reasons this is needed for the correct initialization
environment:
- POSTGRES_PASSWORD=password
expose:
- 5432
ports:
- 5432:5432
networks:
- back
volumes:
- postgresql_data:/var/lib/postgresql/data

midpoint-server:
environment:
- REPO_DATABASE_TYPE=postgresql
- REPO_HOST=postgresql
- REPO_PORT=5432
- REPO_DATABASE=midpoint
- REPO_USER=midpoint

# effectively disable original MariaDB service
midpoint-data:
image: alpine:latest
command: "true"
entrypoint: "true"

volumes:
postgresql_data:
3 changes: 3 additions & 0 deletions demo/postgresql/postgresql/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM postgres:9.5

COPY container_files/* /docker-entrypoint-initdb.d/
12 changes: 12 additions & 0 deletions demo/postgresql/postgresql/container_files/init-user-db.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
set -e

echo Creating midPoint user and database

psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
CREATE USER midpoint WITH PASSWORD '456654' LOGIN SUPERUSER;
CREATE DATABASE midpoint WITH OWNER = midpoint ENCODING = 'UTF8' TABLESPACE = pg_default LC_COLLATE = 'en_US.utf8' LC_CTYPE = 'en_US.utf8' CONNECTION LIMIT = -1;
EOSQL

echo midPoint user and database were created

10 changes: 3 additions & 7 deletions demo/shibboleth/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ services:
ports:
- "389:389"
networks:
- back
- net
volumes:
- ldap:/var/lib/dirsrv

Expand All @@ -21,17 +21,13 @@ services:
- JETTY_BROWSER_SSL_KEYSTORE_PASSWORD=password
- JETTY_BACKCHANNEL_SSL_KEYSTORE_PASSWORD=password
networks:
- front
- back
- net
ports:
- "4443:4443"

networks:
front:
net:
driver: bridge
back:
driver: bridge


volumes:
ldap:

0 comments on commit 8dedf79

Please sign in to comment.