Skip to content

Commit

Permalink
Server configuration + POM version update
Browse files Browse the repository at this point in the history
  • Loading branch information
GuilhemSempere committed Apr 1, 2022
1 parent 4f04c56 commit 376100a
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 6 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ FROM tomcat:8.5.75-jre8-openjdk-slim-bullseye
COPY target/gigwa webapps/gigwa
COPY docker/setenv.sh /usr/local/tomcat/bin/setenv.sh

RUN sed -i 's|Connector port="8080"|Connector port="8080" maxHttpHeaderSize="65536" maxParameterCount="-1" maxPostSize="-1"|g' conf/server.xml \
#env vars to avoid ip/port inside image
RUN echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<beans xmlns=\"http://www.springframework.org/schema/beans\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:mongo=\"http://www.springframework.org/schema/data/mongo\" xsi:schemaLocation=\"http://www.springframework.org/schema/data/mongo http://www.springframework.org/schema/data/mongo/spring-mongo-3.0.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd\">\n<mongo:mongo-client host=\"#{systemEnvironment['MONGO_IP']}\" port=\"#{systemEnvironment['MONGO_PORT']}\" id=\"defaultMongoHost\" credential=\"#{systemEnvironment['MONGO_INITDB_ROOT_USERNAME']}:#{systemEnvironment['MONGO_INITDB_ROOT_PASSWORD']}@admin\" />\n</beans>" > webapps/gigwa/WEB-INF/classes/applicationContext-data.xml \
&& echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<beans xmlns=\"http://www.springframework.org/schema/beans\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:mongo=\"http://www.springframework.org/schema/data/mongo\" xsi:schemaLocation=\"http://www.springframework.org/schema/data/mongo http://www.springframework.org/schema/data/mongo/spring-mongo-3.0.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd\">\n<mongo:mongo-client host=\"#{systemEnvironment['MONGO_IP']}\" port=\"#{systemEnvironment['MONGO_PORT']}\" id=\"defaultMongoHost\" credential=\"#{systemEnvironment['MONGO_INITDB_ROOT_USERNAME']}:#{systemEnvironment['MONGO_INITDB_ROOT_PASSWORD']}@admin\" />\n</beans>" > webapps/gigwa/WEB-INF/classes/applicationContext-data.xml \
&& apt-get update && apt-get install -y wget \
&& wget https://fastdl.mongodb.org/tools/db/mongodb-database-tools-ubuntu1804-x86_64-100.5.2.deb && dpkg -i mongodb-database-tools-ubuntu1804-x86_64-100.5.2.deb && rm -f mongodb-database-tools-ubuntu1804-x86_64-100.5.2.deb \
&& apt-get remove -y wget libpsl5 publicsuffix \
Expand Down
46 changes: 41 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@

<groupId>fr.cirad</groupId>
<artifactId>gigwa2</artifactId>
<version>2.5-beta</version>
<version>2.5-RELEASE</version>
<packaging>war</packaging>

<name>gigwa2</name>

<properties>
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<Gigwa2ServiceImpl.version>2.5-beta</Gigwa2ServiceImpl.version>
<Gigwa2ServiceImpl.version>2.5-RELEASE</Gigwa2ServiceImpl.version>
<bundle.dir>target/bundles</bundle.dir>
<bundle.dir.ubuntu>${bundle.dir}/Gigwa_V${project.version}-Ubuntu</bundle.dir.ubuntu>
<bundle.dir.osx>${bundle.dir}/Gigwa_V${project.version}-OSX</bundle.dir.osx>
Expand Down Expand Up @@ -891,7 +891,7 @@
<executions>
<!-- Set port to 59395 instead of 8080 in server.xml -->
<execution>
<id>set-tomcat-port-ubuntu</id>
<id>set-tomcat-ports-ubuntu</id>
<phase>post-integration-test</phase>
<goals>
<goal>replace</goal>
Expand All @@ -903,11 +903,23 @@
<token>8080</token>
<value>59395</value>
</replacement>
<replacement>
<token>8005</token>
<value>59396</value>
</replacement>
<replacement>
<token>8009</token>
<value>59397</value>
</replacement>
<replacement>
<token>Connector port="59395"</token>
<value>Connector port="59395" maxHttpHeaderSize="65536" maxParameterCount="-1" maxPostSize="-1"</value>
</replacement>
</replacements>
</configuration>
</execution>
<execution>
<id>set-tomcat-port-osx</id>
<id>set-tomcat-ports-osx</id>
<phase>post-integration-test</phase>
<goals>
<goal>replace</goal>
Expand All @@ -919,11 +931,23 @@
<token>8080</token>
<value>59395</value>
</replacement>
<replacement>
<token>8005</token>
<value>59396</value>
</replacement>
<replacement>
<token>8009</token>
<value>59397</value>
</replacement>
<replacement>
<token>Connector port="59395"</token>
<value>Connector port="59395" maxHttpHeaderSize="65536" maxParameterCount="-1" maxPostSize="-1"</value>
</replacement>
</replacements>
</configuration>
</execution>
<execution>
<id>set-tomcat-port-windows</id>
<id>set-tomcat-ports-windows</id>
<phase>post-integration-test</phase>
<goals>
<goal>replace</goal>
Expand All @@ -935,6 +959,18 @@
<token>8080</token>
<value>59395</value>
</replacement>
<replacement>
<token>8005</token>
<value>59396</value>
</replacement>
<replacement>
<token>8009</token>
<value>59397</value>
</replacement>
<replacement>
<token>Connector port="59395"</token>
<value>Connector port="59395" maxHttpHeaderSize="65536" maxParameterCount="-1" maxPostSize="-1"</value>
</replacement>
</replacements>
</configuration>
</execution>
Expand Down

0 comments on commit 376100a

Please sign in to comment.