docker-ahi/tomcat/Dockerfile
2025-12-02 18:18:12 +01:00

55 lines
1.7 KiB
Docker

FROM tomcat:9.0.111-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
# Installa tool di rete e diagnostica
RUN apt-get update && apt-get install -y \
iputils-ping \
inetutils-telnet \
dnsutils \
net-tools \
curl \
wget \
traceroute \
tcpdump \
nmap \
iproute2 \
openssl \
ca-certificates \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# SOLO SE RICHIESTO PER infinity dms converter
#RUN apt-get install libreoffice
RUN 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"]