Allow customizing JDBC URLs at run-time instead of during container build (FINERACT-773)
In Docker, set JAVA_OPTS instead of FINERACT_TENANTS_URL. Because ARG/ENV in the Dockerfile can't (easily) be changed at run-time. At first I tried to override the ENTRYPOINT with a script which sets JAVA_OPTS based on FINERACT_TENANTS_URL and then delegates to the original /app-entrypoint.sh; that didn't immediately work, so this seems simpler. Including make default tenant JDBC hostname & port configurable at Docker container run instead of build time.
This commit is contained in:
+7
-7
@@ -21,23 +21,23 @@ RUN mkdir fineract
|
||||
COPY . fineract
|
||||
|
||||
WORKDIR fineract
|
||||
ARG mysqlserver=fineractmysql
|
||||
RUN sed -i "s/localhost/${mysqlserver}/" ./fineract-provider/src/main/resources/sql/migrations/list_db/V1__mifos-platform-shared-tenants.sql
|
||||
RUN ./gradlew clean -x test war
|
||||
RUN ./gradlew clean -x rat -x test war
|
||||
|
||||
# =========================================
|
||||
|
||||
FROM bitnami/tomcat:7.0.94 as fineract
|
||||
|
||||
USER root
|
||||
ARG mysqlserver=fineractmysql
|
||||
RUN apt-get update -qq && apt-get install -y wget
|
||||
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/jre
|
||||
|
||||
USER root
|
||||
RUN apt-get update -qq && apt-get install -y wget
|
||||
|
||||
COPY --from=builder /fineract/build/libs/fineract-provider.war /opt/bitnami/tomcat/webapps
|
||||
|
||||
RUN keytool -genkey -keyalg RSA -alias tomcat -keystore /opt/bitnami/tomcat/tomcat.keystore -keypass xyz123 -storepass xyz123 -noprompt -dname "CN=Fineract, OU=Fineract, O=Fineract, L=Unknown, ST=Unknown, C=Unknown"
|
||||
COPY ./docker/server.xml /opt/bitnami/tomcat/conf
|
||||
RUN sed -i "s/fineractmysql/${mysqlserver}/" /opt/bitnami/tomcat/conf/server.xml
|
||||
RUN chmod 664 /opt/bitnami/tomcat/conf/server.xml
|
||||
WORKDIR /opt/bitnami/tomcat/lib
|
||||
# org.drizzle.jdbc.DrizzleDriver is used in docker/server.xml for jdbc/mifosplatform-tenants DataSource
|
||||
# (But note that connections to individual tenant DBs may use another driver...)
|
||||
RUN wget http://central.maven.org/maven2/org/drizzle/jdbc/drizzle-jdbc/1.4/drizzle-jdbc-1.4.jar
|
||||
|
||||
Reference in New Issue
Block a user