diff --git a/README.md b/README.md index 833c474..5c45633 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,7 @@ CONTAINER PER ADHOC INFINITY E ADHOC REVOLUTION WEB VERSIONE 4.2 - 1) eseguire lo script script_init 2) impostare utente esecutore del tomcat in docker-compose (settare UID/GUID e nome utente e gruppo) 2) configurare apache.conf in apache/conf -3) deploy con docker-compose up --build -d \ No newline at end of file +3) deploy con docker-compose -f up --build -d \ No newline at end of file diff --git a/docker-compose-multi.yml b/docker-compose-multi.yml new file mode 100644 index 0000000..1e27d28 --- /dev/null +++ b/docker-compose-multi.yml @@ -0,0 +1,22 @@ +#installazione multitenant, senza apache proxy +services: + tomcat: + build: + context: ./tomcat + dockerfile: Dockerfile + args: + USER_ID: 1000 + GROUP_ID: 1000 + USERNAME: polo + GROUPNAME: polo + container_name: tomcat + ports: + - "x009:8009" #inoltro porta ajp, lasciato errato volontariamente + volumes: + - ./tomcat/webapps:/usr/local/tomcat/webapps + - ./tomcat/logs:/usr/local/tomcat/logs + environment: + JAVA_OPTS: "-Dfile.encoding=UTF-8 -Xms1g -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/docker-compose.yml b/docker-compose-single.yml similarity index 86% rename from docker-compose.yml rename to docker-compose-single.yml index 17dc1ae..c99ace4 100644 --- a/docker-compose.yml +++ b/docker-compose-single.yml @@ -1,3 +1,4 @@ +#installazione singolo tenant con apache incluso services: tomcat: build: @@ -11,8 +12,8 @@ services: container_name: tomcat network_mode: host volumes: - - ./tomcat/tomcat_webapps:/usr/local/tomcat/webapps - - ./tomcat/tomcat_logs:/usr/local/tomcat/logs + - ./tomcat/webapps:/usr/local/tomcat/webapps + - ./tomcat/logs:/usr/local/tomcat/logs environment: JAVA_OPTS: "-Dfile.encoding=UTF-8 -Xms1g -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" diff --git a/tomcat/Dockerfile b/tomcat/Dockerfile index 40637d0..c284cb4 100644 --- a/tomcat/Dockerfile +++ b/tomcat/Dockerfile @@ -15,19 +15,19 @@ RUN apt-get update && \ apt-get install -y gosu libreoffice && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* - + # CONFIG -COPY ./tomcat_conf/catalina.properties /usr/local/tomcat/conf/catalina.properties -COPY ./tomcat_conf/context.xml /usr/local/tomcat/conf/context.xml -COPY ./tomcat_conf/server.xml /usr/local/tomcat/conf/server.xml +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 # JDBC -COPY ./libs/postgresql-42.6.0.jar /usr/local/tomcat/lib/postgresql-42.6.0.jar +COPY ./libs/ /usr/local/tomcat/lib/ # Set permissions on Tomcat directories RUN chown -R ${USERNAME}:${GROUPNAME} /usr/local/tomcat -# Ensure the required dconf cache directory exists and has the correct permissions +# Ensure the required dconf cache directory exists and has the correct permissions (per libreoffice) RUN mkdir -p /home/${USERNAME}/.cache/dconf && \ chown -R ${USERNAME}:${GROUPNAME} /home/${USERNAME}/.cache/dconf diff --git a/tomcat/tomcat_conf/catalina.properties b/tomcat/conf/catalina.properties similarity index 100% rename from tomcat/tomcat_conf/catalina.properties rename to tomcat/conf/catalina.properties diff --git a/tomcat/tomcat_conf/context.xml b/tomcat/conf/context.xml similarity index 100% rename from tomcat/tomcat_conf/context.xml rename to tomcat/conf/context.xml diff --git a/tomcat/tomcat_conf/server.xml b/tomcat/conf/server.xml similarity index 100% rename from tomcat/tomcat_conf/server.xml rename to tomcat/conf/server.xml diff --git a/tomcat/tomcat_logs/placeholder b/tomcat/logs/placeholder similarity index 100% rename from tomcat/tomcat_logs/placeholder rename to tomcat/logs/placeholder diff --git a/tomcat/tomcat_webapps/placeholder b/tomcat/webapps/placeholder similarity index 100% rename from tomcat/tomcat_webapps/placeholder rename to tomcat/webapps/placeholder diff --git a/tomcat/tomcat_webapps_offline/placeholder b/tomcat/webapps_offline/placeholder similarity index 100% rename from tomcat/tomcat_webapps_offline/placeholder rename to tomcat/webapps_offline/placeholder