Skip to content

Commit

Permalink
fix: add postgres compose file
Browse files Browse the repository at this point in the history
  • Loading branch information
moabu committed Feb 14, 2023
1 parent 7eefe4b commit 808748f
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 24 deletions.
14 changes: 10 additions & 4 deletions docker-flex-monolith/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,23 @@ ENV CN_HOSTNAME="demoexample.gluu.org" \
CN_CITY="Austin" \
CN_STATE="TX" \
CN_COUNTRY="US" \
TEST_CLIENT_ID="9876baac-de39-4c23-8a78-674b59df8c09" \
TEST_CLIENT_SECRET="" \
TEST_CLIENT_TRUSTED="true" \
IS_FQDN_REGISTERED="false" \
# Install with local mysql by default
INSTALL_LDAP="false" \
CN_INSTALL_LDAP="false" \
CN_INSTALL_MYSQL="false" \
CN_INSTALL_PGSQL="false" \
CN_INSTALL_CONFIG_API="true" \
CN_INSTALL_SCIM="true" \
CN_INSTALL_FIDO2="true" \
CN_INSTALL_CASA="true" \
CN_INSTALL_ADMIN_UI="true" \
MYSQL_DATABASE="gluu" \
MYSQL_USER="gluu" \
MYSQL_PASSWORD=""
RDBMS_DATABASE="gluu" \
RDBMS_USER="gluu" \
RDBMS_PASSWORD="" \
RDBMS_HOST=""

# ==========
# misc stuff
Expand Down
8 changes: 4 additions & 4 deletions docker-flex-monolith/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ The following environment variables are supported by the container:
| `CN_INSTALL_FIDO2` | Installs the FIDO2 API service. | `true` |
| `CN_INSTALL_CASA` | Installs the Casa service. | `true` |
| `CN_INSTALL_ADMIN_UI` | Installs the Admin UI service. | `true` |
| `MYSQL_DATABASE` | MySQL gluu flex database. | `gluu` |
| `MYSQL_USER` | MySQL database user. | `gluu` |
| `MYSQL_PASSWORD` | MySQL database user password. | `1t5Fin3#security` |
| `MYSQL_HOST` | MySQL host. | `mysql` which is the docker compose service name |
| `RDBMS_DATABASE` | MySQL gluu flex database. | `gluu` |
| `RDBMS_USER` | MySQL database user. | `gluu` |
| `RDBMS_PASSWORD` | MySQL database user password. | `1t5Fin3#security` |
| `RDBMS_HOST` | MySQL host. | `mysql` which is the docker compose service name |


## Pre-requisites
Expand Down
18 changes: 11 additions & 7 deletions docker-flex-monolith/flex-mysql-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ services:
networks:
- cloud_bridge
environment:
- MYSQL_DATABASE=gluu
- MYSQL_USER=gluu
- MYSQL_PASSWORD=1t5Fin3#security
- RDBMS_DATABASE=gluu
- RDBMS_USER=gluu
- RDBMS_PASSWORD=1t5Fin3#security
- MYSQL_ROOT_PASSWORD=1t5Fin3#security
flex:
image: gluufederation/monolith:5.0.0_dev
Expand All @@ -33,16 +33,20 @@ services:
- CN_CITY=Austin
- CN_STATE=TX
- CN_COUNTRY=US
- CN_INSTALL_MYSQL=true
- IS_FQDN_REGISTERED=false
- CN_INSTALL_CONFIG_API=true
- CN_INSTALL_SCIM=true
- CN_INSTALL_FIDO2=true
- CN_INSTALL_CASA=true
- CN_INSTALL_ADMIN_UI=true
- MYSQL_DATABASE=gluu
- MYSQL_USER=gluu
- MYSQL_PASSWORD=1t5Fin3#security
- MYSQL_HOST=mysql
- TEST_CLIENT_ID=9876baac-de39-4c23-8a78-674b59df8c09
- TEST_CLIENT_TRUSTED=true
- TEST_CLIENT_SECRET=1t5Fin3#security
- RDBMS_DATABASE=gluu
- RDBMS_USER=gluu
- RDBMS_PASSWORD=1t5Fin3#security
- RDBMS_HOST=mysql
volumes:
- ./jans-auth-custom:/opt/jans/jetty/jans-auth/custom
- ./jans-config-api-custom:/opt/jans/jetty/jans-config-api/custom
Expand Down
57 changes: 57 additions & 0 deletions docker-flex-monolith/flex-postgres-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
version: "3.7"
services:
pgsql:
image: postgres:15.1
restart: always
ports:
- "5432:5432"
volumes:
- db-data:/var/lib/postgresql/data/
networks:
- cloud_bridge
environment:
POSTGRES_USER: jans
POSTGRES_PASSWORD: 1t5Fin3#security
POSTGRES_DB: jans
jans:
image: gluufederation/monolith:5.0.0_dev
restart: always
ports:
- "443:443"
- "80:80"
depends_on:
- pgsql
networks:
- cloud_bridge
environment:
- CN_HOSTNAME=demoexample.gluu.org
- CN_ADMIN_PASS=1t5Fin3#security
- CN_ORG_NAME=Janssen
- CN_EMAIL=support@gluu.org
- CN_CITY=Austin
- CN_STATE=TX
- CN_COUNTRY=US
- CN_INSTALL_PGSQL=true
- IS_FQDN_REGISTERED=false
- CN_INSTALL_CONFIG_API=true
- CN_INSTALL_SCIM=true
- CN_INSTALL_FIDO2=true
- CN_INSTALL_CASA=true
- CN_INSTALL_ADMIN_UI=true
- TEST_CLIENT_ID=9876baac-de39-4c23-8a78-674b59df8c09
- TEST_CLIENT_TRUSTED=true
- TEST_CLIENT_SECRET=1t5Fin3#security
- RDBMS_DATABASE=jans
- RDBMS_USER=jans
- RDBMS_PASSWORD=1t5Fin3#security
- RDBMS_HOST=pgsql
volumes:
- ./jans-auth-custom:/opt/jans/jetty/jans-auth/custom
- ./jans-config-api-custom:/opt/jans/jetty/jans-config-api/custom
- ./jans-fido2-custom:/opt/jans/jetty/jans-fido2/custom
- ./jans-scim-custom:/opt/jans/jetty/jans-scim/custom
volumes:
db-data:
networks:
cloud_bridge:
driver: bridge
30 changes: 21 additions & 9 deletions docker-flex-monolith/scripts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ set -e
# CN_INSTALL_SCIM
# CN_INSTALL_CASA
# CN_INSTALL_ADMIN_UI
# MYSQL_DATABASE
# MYSQL_USER
# MYSQL_PASSWORD
# RDBMS_DATABASE
# RDBMS_USER
# RDBMS_PASSWORD
# ======================================================================================================================

IS_FLEX_DEPLOYED=/flex/deployed
Expand All @@ -43,17 +43,29 @@ install_flex() {
echo "install-admin-ui=""$([[ ${CN_INSTALL_ADMIN_UI} == true ]] && echo True || echo False)" | tee -a setup.properties > /dev/null
echo "install-casa=""$([[ ${CN_INSTALL_CASA} == true ]] && echo True || echo False)" | tee -a setup.properties > /dev/null
echo "adminui-authentication-mode=casa" | tee -a setup.properties > /dev/null

if [[ "${INSTALL_LDAP}" == "false" ]]; then
echo "test_client_id=${TEST_CLIENT_ID}"| tee -a setup.properties > /dev/null
echo "test_client_secret=${TEST_CLIENT_SECRET}" | tee -a setup.properties > /dev/null
echo "test_client_trusted=""$([[ ${TEST_CLIENT_TRUSTED} == true ]] && echo True || echo True)" | tee -a setup.properties > /dev/null
if [[ "${CN_INSTALL_MYSQL}" == "true" ]] || [[ "${CN_INSTALL_PGSQL}" == "true" ]]; then
echo "Installing with RDBMS"
echo "rdbm_install=2" | tee -a setup.properties > /dev/null
echo "rdbm_install_type=2" | tee -a setup.properties > /dev/null
echo "rdbm_db=${MYSQL_DATABASE}" | tee -a setup.properties > /dev/null
echo "rdbm_user=${MYSQL_USER}" | tee -a setup.properties > /dev/null
echo "rdbm_password=${MYSQL_PASSWORD}" | tee -a setup.properties > /dev/null
echo "rdbm_db=${RDBMS_DATABASE}" | tee -a setup.properties > /dev/null
echo "rdbm_user=${RDBMS_USER}" | tee -a setup.properties > /dev/null
echo "rdbm_password=${RDBMS_PASSWORD}" | tee -a setup.properties > /dev/null
echo "rdbm_host=${RDBMS_HOST}" | tee -a setup.properties > /dev/null
fi
if [[ "${CN_INSTALL_MYSQL}" == "true" ]]; then
echo "Installing with MySql"
echo "rdbm_type=mysql" | tee -a setup.properties > /dev/null
echo "rdbm_host=${MYSQL_HOST}" | tee -a setup.properties > /dev/null
echo "rdbm_port=3306" | tee -a setup.properties > /dev/null
elif [[ "${CN_INSTALL_PGSQL}" == "true" ]]; then
echo "Installing with Postgres"
echo "rdbm_type=pgsql" | tee -a setup.properties > /dev/null
echo "rdbm_port=5432" | tee -a setup.properties > /dev/null
fi


echo "***** Running the setup script for ${CN_ORG_NAME}!! *****"
echo "***** PLEASE NOTE THAT THIS MAY TAKE A WHILE TO FINISH. PLEASE BE PATIENT!! *****"
echo "***** Installing Gluu Flex..."
Expand Down

0 comments on commit 808748f

Please sign in to comment.