Skip to content

Commit

Permalink
Improve admincommon's Dockerfile (for #2)
Browse files Browse the repository at this point in the history
  • Loading branch information
richardjs committed Jun 1, 2022
1 parent a13c31c commit fa4911b
Showing 1 changed file with 22 additions and 27 deletions.
49 changes: 22 additions & 27 deletions contexts/admincommon/Dockerfile.dist
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,39 @@ ENV TZ=^TIMEZONE^
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

COPY ["ojdbc8.jar", "/usr/local/tomcat/lib/"]

COPY ["context.xml", "/usr/local/tomcat/conf/"]
COPY ["server.xml", "/usr/local/tomcat/conf/"]
COPY ["setenv.sh", "/usr/local/tomcat/bin/setenv.sh"]

COPY ["limits.conf", "/etc/security/limits.conf"]

WORKDIR /usr/local/tomcat/webapps
COPY ["BannerAdmin.war", "."]
RUN unzip BannerAdmin.war -d BannerAdmin
RUN rm BannerAdmin.war

COPY ["BannerAdmin.ws.war", "."]
RUN unzip BannerAdmin.ws.war -d BannerAdmin.ws
RUN rm BannerAdmin.ws.war
RUN unzip BannerAdmin.war -d BannerAdmin && \
rm BannerAdmin.war && \
unzip BannerAdmin.ws.war -d BannerAdmin.ws && \
rm BannerAdmin.ws.war

WORKDIR /usr/local/tomcat/webapps/BannerAdmin.ws/WEB-INF/
RUN sed -i "s/<session-timeout>60<\/session-timeout>/<session-timeout>\${banner9.session_timeout}<\/session-timeout>/" web.xml

WORKDIR /usr/local/tomcat/webapps/BannerAdmin.ws/WEB-INF/classes/
RUN sed -i "s/^connection.proxy.user.*=.*/connection.proxy.user=\${banner9.proxy.user}/" config.properties && \
sed -i "s/^connection.proxy.password.*=.*/connection.proxy.password=\${banner9.proxy.password}/" config.properties && \
sed -i "s/^connection.user.*=.*/connection.user=\${banner9.connection.user}/" config.properties && \
sed -i "s/^connection.password.*=.*/connection.password=\${banner9.connection.password}/" config.properties && \
sed -i "s/^connection.host.*=.*/connection.host=\${oracle.host}/" config.properties && \
sed -i "s/^connection.database.*=.*/connection.database=\${oracle.sid}/" config.properties && \
sed -i "s/^cas.server.location.*=.*/cas.server.location=\${cas.url}/" config.properties && \
sed -i "s/^webapp.wrksp.context.*/webapp.wrksp.context=BannerAdmin/" config.properties && \
sed -i "s/^webapp.context.*/webapp.context=BannerAdmin.ws/" config.properties && \
sed -i "s/^webapp.location.*=.*/webapp.location=\${banner9.root}\/\${webapp.context}/" config.properties && \
sed -i "s/^webapp.wrksp.location.*=.*/webapp.wrksp.location=\${banner9.root}\/\${webapp.wrksp.context}/" config.properties && \
sed -i "s/<session-timeout>60<\/session-timeout>/<session-timeout>\${banner9.session_timeout}<\/session-timeout>/" ../web.xml

RUN sed -i "s/^connection.proxy.user.*=.*/connection.proxy.user=\${banner9.proxy.user}/" config.properties
RUN sed -i "s/^connection.proxy.password.*=.*/connection.proxy.password=\${banner9.proxy.password}/" config.properties
RUN sed -i "s/^connection.user.*=.*/connection.user=\${banner9.connection.user}/" config.properties
RUN sed -i "s/^connection.password.*=.*/connection.password=\${banner9.connection.password}/" config.properties
RUN sed -i "s/^connection.host.*=.*/connection.host=\${oracle.host}/" config.properties
RUN sed -i "s/^connection.database.*=.*/connection.database=\${oracle.sid}/" config.properties
RUN sed -i "s/^cas.server.location.*=.*/cas.server.location=\${cas.url}/" config.properties

RUN sed -i "s/^webapp.wrksp.context.*/webapp.wrksp.context=BannerAdmin/" config.properties
RUN sed -i "s/^webapp.context.*/webapp.context=BannerAdmin.ws/" config.properties

RUN sed -i "s/^webapp.location.*=.*/webapp.location=\${banner9.root}\/\${webapp.context}/" config.properties
RUN sed -i "s/^webapp.wrksp.location.*=.*/webapp.wrksp.location=\${banner9.root}\/\${webapp.wrksp.context}/" config.properties
ENV CATALINA_OPTS="-server -Xms14g -Xmx14g -Doracle.jdbc.autoCommitSpecCompliant=false"

WORKDIR /usr/local/tomcat/
COPY ["setenv.sh", "bin/setenv.sh"]

RUN useradd tomcat
RUN chown -R tomcat.tomcat /usr/local/tomcat
RUN useradd tomcat && \
chown -R tomcat.tomcat /usr/local/tomcat
USER tomcat

copy ["limits.conf", "/etc/security/limits.conf"]
ENV CATALINA_OPTS="-server -Xms14g -Xmx14g -Doracle.jdbc.autoCommitSpecCompliant=false"

0 comments on commit fa4911b

Please sign in to comment.