Skip to content

Commit

Permalink
feature: Added environment variable for changing the deployment context
Browse files Browse the repository at this point in the history
The primefaces library doesn't seem to support reverseproxy, so the only option is to change the context path of deployment
  • Loading branch information
torbrenner committed Sep 7, 2021
1 parent 419d7ac commit 59a3e7a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/deployment/docker-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,6 @@ If postgres connection errors occur, try your ip for POSTGRES_HOST. For all Envi
| CATALINA_OPTS | | JVM options |
| TOMCAT_REVERSEPROXY_FQDN | | The FQDN of share-client then run behind a reverse proxy. See [Tomcat Connector](https://tomcat.apache.org/tomcat-8.5-doc/config/http.html) "proxyName" for more information.|
| TOMCAT_REVERSEPROXY_SSL | | Whether the reverse proxy is running SSL or not. Set either to true or false. Automatically configures [Tomcat Connector](https://tomcat.apache.org/tomcat-8.5-doc/config/http.html) "proxyPort", "scheme" and "secure".|
| DEPLOYMENT_CONTEXT | | The subpath of the bridgehead installation. Normally bridgehead will be deployed to ROOT, but with this variable you can change it for example to "connector". It is not possible to pass multiple subdirectories like "connector/samply".|

*necessary
7 changes: 7 additions & 0 deletions src/docker/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ if [ -n "$HTTP_PROXY" ]; then
fi

file=${CATALINA_HOME}/conf/Catalina/localhost/ROOT.xml
if [ -n "$DEPLOYMENT_CONTEXT" ]; then
echo "INFO: preparing deployment in context ${DEPLOYMENT_CONTEXT}"
mv "${CATALINA_HOME}"/webapps/ROOT "${CATALINA_HOME}"/webapps/"${DEPLOYMENT_CONTEXT}"
mv "${CATALINA_HOME}"/conf/Catalina/localhost/ROOT.xml "${CATALINA_HOME}"/conf/Catalina/localhost/"${DEPLOYMENT_CONTEXT}".xml
fi

file="${CATALINA_HOME}"/conf/Catalina/localhost/"${DEPLOYMENT_CONTEXT:-ROOT}".xml
sed -i "s/{postgres-host}/${POSTGRES_HOST}/" "$file"
sed -i "s/{postgres-port}/${POSTGRES_PORT:-5432}/" "$file"
sed -i "s/{postgres-db}/${POSTGRES_DB}/" "$file"
Expand Down

0 comments on commit 59a3e7a

Please sign in to comment.