FROM tomcat:9.0.89-jdk17 # 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 # SUPPORTO A VERSIONI VECCHIE DI SQL SERVER (ERRORI SSL) # Check if java.security exists at the correct path and remove any disabled algorithms # RUN if [ -f /opt/java/openjdk/conf/security/java.security ]; then sed -i '/jdk.tls.disabledAlgorithms/d' /opt/java/openjdk/conf/security/java.security; else echo "java.security file not found"; fi # Install necessary packages, including ping, telnet, openssl, and CA certificates, and clean up RUN apt-get update && \ apt-get install -y \ iputils-ping \ # For ping inetutils-telnet \ # For telnet openssl \ # For openssl commands ca-certificates \ # For SSL/TLS certificate validation #libreoffice && \ # SOLO SE RICHIESTO PER GENERAZIONE DOCX CRM apt-get clean && \ rm -rf /var/lib/apt/lists/* # 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 # Librerie 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 (per libreoffice) #RUN mkdir -p /home/${USERNAME}/.cache/dconf && \ # chown -R ${USERNAME}:${GROUPNAME} /home/${USERNAME}/.cache/dconf USER ${USERNAME} CMD ["catalina.sh", "run"]