Last active
October 11, 2024 03:48
-
-
Save maxisandoval37/7f47aff904a8e776f78c933af3fb3899 to your computer and use it in GitHub Desktop.
Dockerfile for Maven Java WAR (jdk 17)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# --Dockerfile for Maven Java WAR (jdk 17)--- | |
FROM maven:3.8.5-openjdk-17 AS build | |
WORKDIR /app | |
COPY pom.xml . | |
COPY src ./src | |
RUN mvn clean package -DskipTests | |
FROM tomcat:10.1-jdk17 | |
WORKDIR /usr/local/tomcat/webapps/ | |
COPY --from=build /app/target/*.war ./ROOT.war | |
# Configuración para evitar el escaneo innecesario de JARs | |
RUN echo '<?xml version="1.0" encoding="UTF-8"?><Context><JarScanner><JarScanFilter defaultPluggabilityScan="false"/></JarScanner></Context>' > /usr/local/tomcat/conf/context.xml | |
ENV JAVA_OPTS="-Djava.security.egd=file:/dev/urandom" | |
EXPOSE 8080 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment