Skip to content

Commit

Permalink
Fixed Snapshot docker version.
Browse files Browse the repository at this point in the history
  • Loading branch information
vertigo17 committed Jan 25, 2025
1 parent f743db5 commit 73c8f63
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 16 deletions.
33 changes: 21 additions & 12 deletions docker/images/cerberus-as-tomcat-keycloak/SNAPSHOT/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,41 +1,48 @@
FROM tomcat:8-jre8-alpine
FROM tomcat:9-jre11-temurin

ENV LOG_ROOT_PATH /usr/local/tomcat/logs/

ENV KEYCLOACK_REALM Cerberus
ENV KEYCLOACK_CLIENT cerberus
ENV KEYCLOACK_URL http://192.168.1.1:8080/auth
ENV CATALINA_OPTS="-Dorg.cerberus.environment=prd -Dorg.cerberus.authentification=keycloak -Xmx1024m"
ENV KEYCLOACK_VERSION 8.0.2
ENV KEYCLOACK_TOMCAT8_ADAPTER_NAME keycloak-tomcat-adapter-dist-${KEYCLOACK_VERSION}
ENV KEYCLOACK_VERSION 18.0.1
ENV KEYCLOACK_TOMCAT8_ADAPTER_NAME keycloak-oidc-tomcat-adapter-${KEYCLOACK_VERSION}

ENV DATABASE_HOST cerberus-db-mysql
ENV DATABASE_PORT 3306
ENV DATABASE_NAME cerberus
ENV DATABASE_USER cerberus
ENV DATABASE_PASSWORD toto

ARG CERBERUS_NAME=Cerberus
ARG CERBERUS_VERSION=SNAPSHOT
ARG CERBERUS_NAME=cerberus-core
ARG CERBERUS_VERSION=4.18
ARG CERBERUS_PACKAGE_NAME=${CERBERUS_NAME}-${CERBERUS_VERSION}

ARG MYSQL_JAVA_CONNECTOR_VERSION=5.1.47
ARG MYSQL_JAVA_CONNECTOR_NAME=mysql-connector-java-${MYSQL_JAVA_CONNECTOR_VERSION}
ARG MYSQL_JAVA_CONNECTOR_VERSION=9.0.0
ARG MYSQL_JAVA_CONNECTOR_NAME=mysql-connector-j-${MYSQL_JAVA_CONNECTOR_VERSION}


RUN apt-get update -qqy \
&& apt-get -qqy install \
unzip dos2unix \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*

# Download and install MySQL JDBC Drivers
RUN echo "Download & install MySQL JDBC Drivers" && \
wget -P /tmp/ https://downloads.mysql.com/archives/get/p/3/file/${MYSQL_JAVA_CONNECTOR_NAME}.zip && \
unzip -q -d /tmp/ /tmp/${MYSQL_JAVA_CONNECTOR_NAME}.zip && \
mv /tmp/${MYSQL_JAVA_CONNECTOR_NAME}/${MYSQL_JAVA_CONNECTOR_NAME}-bin.jar /usr/local/tomcat/lib/ && \
mv /tmp/${MYSQL_JAVA_CONNECTOR_NAME}/${MYSQL_JAVA_CONNECTOR_NAME}.jar /usr/local/tomcat/lib/ && \
echo "Clean temp directory" && \
rm /tmp/* -rf
#COPY mysql-connector-java-5.1.20-bin.jar /usr/local/tomcat/lib/

# Only for debug purpose
#RUN ls -al /usr/local/tomcat/lib/

# https://github.com/keycloak/keycloak/releases/download/${KEYCLOACK_VERSION}/keycloak-oidc-tomcat-adapter-${KEYCLOACK_VERSION}.zip
# https://downloads.jboss.org/keycloak/${KEYCLOACK_VERSION}/adapters/keycloak-oidc/${KEYCLOACK_TOMCAT8_ADAPTER_NAME}.zip
# Download & install KeyCloak adapter to manage authentification with Tomcat
RUN wget -P /tmp/ https://downloads.jboss.org/keycloak/${KEYCLOACK_VERSION}/adapters/keycloak-oidc/${KEYCLOACK_TOMCAT8_ADAPTER_NAME}.zip && \
RUN wget -P /tmp/ https://github.com/keycloak/keycloak/releases/download/${KEYCLOACK_VERSION}/${KEYCLOACK_TOMCAT8_ADAPTER_NAME}.zip && \
unzip -q -d /usr/local/tomcat/lib/ /tmp/${KEYCLOACK_TOMCAT8_ADAPTER_NAME}.zip && \
echo "Clean temp directory" && \
rm /tmp/* -rf
Expand All @@ -46,11 +53,13 @@ RUN wget -P /tmp/ https://downloads.jboss.org/keycloak/${KEYCLOACK_VERSION}/adap

# Download & install Cerberus Application
RUN echo "Download & install Cerberus Application" && \
wget -P /tmp/ https://vm.cerberus-testing.org/delivery/Cerberus-${CERBERUS_VERSION}.war && \
wget -P /tmp/ https://github.com/cerberustesting/cerberus-source/releases/download/cerberus-testing-${CERBERUS_VERSION}/cerberus-core-${CERBERUS_VERSION}.zip && \
unzip -q -d /tmp /tmp/${CERBERUS_PACKAGE_NAME}.zip && \
rm -rf /usr/local/tomcat/webapps/* && \
cp /tmp/Cerberus-${CERBERUS_VERSION}.war /usr/local/tomcat/webapps/ROOT.war && \
cp /tmp/${CERBERUS_PACKAGE_NAME}/${CERBERUS_PACKAGE_NAME}.war /usr/local/tomcat/webapps/ROOT.war && \
echo "Clean temp directory" && \
rm /tmp/* -rf
#COPY Cerberus-3.12-SNAPSHOT.war /usr/local/tomcat/webapps/ROOT.war

# Only for debug purpose
#RUN ls -al /usr/local/tomcat/webapps/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<!-- Default set of monitored resources. If one of these changes, the -->
<!-- web application will be reloaded. -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<WatchedResource>WEB-INF/tomcat-web.xml</WatchedResource>
<WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>

<ResourceLink name="jdbc/cerberusprd"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

# Cerberus Tomcat configuration (with Keycloack acticated)

export CATALINA_OPTS="$CATALINA_OPTS -DDATABASE_HOST=$DATABASE_HOST -DDATABASE_PORT=$DATABASE_PORT -DDATABASE_NAME=$DATABASE_NAME -DDATABASE_USER=$DATABASE_USER -DDATABASE_PASSWORD=$DATABASE_PASSWORD -Dorg.cerberus.keycloak.realm=${KEYCLOACK_REALM} -Dorg.cerberus.keycloak.client=${KEYCLOACK_CLIENT} -Dorg.cerberus.keycloak.url=${KEYCLOACK_URL}"
export CATALINA_OPTS="$CATALINA_OPTS -DDATABASE_HOST=$DATABASE_HOST -DDATABASE_PORT=$DATABASE_PORT -DDATABASE_NAME=$DATABASE_NAME -DDATABASE_USER=$DATABASE_USER -DDATABASE_PASSWORD=$DATABASE_PASSWORD -Dorg.cerberus.authentification=keycloak -Dorg.cerberus.keycloak.realm=${KEYCLOAK_REALM} -Dorg.cerberus.keycloak.client=${KEYCLOAK_CLIENT} -Dorg.cerberus.keycloak.url=${KEYCLOAK_URL}"

/usr/local/tomcat/bin/catalina.sh start

Expand Down
7 changes: 4 additions & 3 deletions docker/images/cerberus-as-tomcat-keycloak/SNAPSHOT/server.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
testWhileIdle="true"
username="${DATABASE_USER}"
password="${DATABASE_PASSWORD}"
driverClassName="com.mysql.jdbc.Driver"
driverClassName="com.mysql.cj.jdbc.Driver"
url="jdbc:mysql://${DATABASE_HOST}:${DATABASE_PORT}/${DATABASE_NAME}"/>


Expand Down Expand Up @@ -85,7 +85,7 @@
-->
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
redirectPort="8443" maxSavePostSize ="2097152"/>
<!-- A "Connector" using the shared thread pool-->
<!--
<Connector executor="tomcatThreadPool"
Expand Down Expand Up @@ -130,8 +130,9 @@
-->

<!-- Define an AJP 1.3 Connector on port 8009 -->
<!--
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

-->

<!-- An Engine represents the entry point (within Catalina) that processes
every request. The Engine implementation for Tomcat stand alone
Expand Down

0 comments on commit 73c8f63

Please sign in to comment.