diff --git a/docker-compose-infinity24.yml b/docker-compose-infinity24.yml new file mode 100644 index 0000000..f900345 --- /dev/null +++ b/docker-compose-infinity24.yml @@ -0,0 +1,20 @@ +services: + tomcat: + build: + context: ./tomcat + dockerfile: Dockerfile_infinity24 + args: + USER_ID: 1000 + GROUP_ID: 1000 + USERNAME: poloadm + GROUPNAME: poloadm + container_name: tomcat + network_mode: host + volumes: + - ./tomcat/webapps:/usr/local/tomcat/webapps + - ./tomcat/logs:/usr/local/tomcat/logs + environment: + JAVA_OPTS: "-Dfile.encoding=UTF-8 -Xms512m -Xmx4g -XX:MetaspaceSize=512m -XX:MaxMetaspaceSize=1g -Djava.security.egd=file:/dev/./urandom -Djava.awt.headless=true" + CATALINA_OPTS: "-XX:CompressedClassSpaceSize=512m -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -Xss2m -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:+AlwaysPreTouch -XX:+UseStringDeduplication -XX:ParallelGCThreads=4 -XX:ConcGCThreads=2 -XX:+DisableExplicitGC" + TZ: "Europe/Rome" + restart: always diff --git a/tomcat/Dockerfile_infinity24 b/tomcat/Dockerfile_infinity24 new file mode 100644 index 0000000..f3777c8 --- /dev/null +++ b/tomcat/Dockerfile_infinity24 @@ -0,0 +1,32 @@ +FROM tomcat:7.0.109-jdk8 + +# Define arguments for the group and user IDs +ARG USER_ID +ARG GROUP_ID +ARG USERNAME +ARG GROUPNAME + +# Create group and user with IDs passed from Docker Compose +RUN groupadd -g ${GROUP_ID} ${GROUPNAME} && \ + useradd --no-log-init -u ${USER_ID} -g ${GROUP_ID} -m ${USERNAME} || true + +# CONFIG +#COPY ./conf/catalina.properties /usr/local/tomcat/conf/catalina.properties +COPY ./conf/context.xml /usr/local/tomcat/conf/context.xml +COPY ./conf/server.xml /usr/local/tomcat/conf/server.xml + +# Copy libraries +COPY ./libs/ /usr/local/tomcat/lib/ + +# Set permissions on Tomcat directories +RUN chown -R ${USERNAME}:${GROUPNAME} /usr/local/tomcat + +# Copy entrypoint script and make it executable +COPY entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] + +USER ${USERNAME} + +CMD ["catalina.sh", "run"]