Skip to content

Commit

Permalink
#157: Modify docker-compose to define realm_name based on KEYCLOAK_RE…
Browse files Browse the repository at this point in the history
…ALM as defined in .env.template
  • Loading branch information
kenmeacham committed Sep 6, 2024
1 parent d961a0c commit e8c808f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
# Location of the Spyderisk System Modeller documentation to be used in the web application:
#DOCUMENTATION_URL=https://spyderisk.org/documentation/modeller/latest/

# Set this if the realm name is different to the default value of 'ssm-realm'.
#KEYCLOAK_REALM=ssm-realm

# Secret shared for communication between Spyderisk and Keycloak services
# The docker-compose.yaml file demonstrates how to insert the value into the Keycloak configuration
#KEYCLOAK_CREDENTIALS_SECRET=DfkQBcVpjbO6gTMXMBUBfHe45UmFhGxk
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ services:
kc_proxy_pass: '${EXTERNAL_KEYCLOAK_AUTH_SERVER_URL:-http://keycloak:8080/auth}'
documentation_url: '${DOCUMENTATION_URL:-https://spyderisk.org/documentation/modeller/latest/}'
tomcat_port: ${TOMCAT_PORT:-8081}
realm_name: '${KEYCLOAK_REALM:-ssm-realm}'
# When nginx starts it does a health check on the "upstream" servers and if none of them in a group are present it will fail.
# Hence, nginx must start after the ssm and keycloak.
# See https://docs.nginx.com/nginx/admin-guide/load-balancer/tcp-health-check/
Expand Down
2 changes: 1 addition & 1 deletion provisioning/nginx/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# `nginx.conf.template` to `nginx.conf` Then the `nginx` command is run the
# nginx service.

envsubst '$${scheme} $${server_port} $${kc_proxy_pass} $${documentation_url} $${tomcat_port}' < \
envsubst '$${scheme} $${server_port} $${kc_proxy_pass} $${documentation_url} $${tomcat_port} $${realm_name}' < \
/tmp/import/nginx.conf.template > /etc/nginx/nginx.conf

nginx -g 'daemon off;'

0 comments on commit e8c808f

Please sign in to comment.