Initial commit
This commit is contained in:
37
Dockerfile
Normal file
37
Dockerfile
Normal file
@@ -0,0 +1,37 @@
|
||||
####
|
||||
# This Dockerfile is used to build a production-ready Quarkus application
|
||||
####
|
||||
|
||||
## Stage 1 : Build with Maven
|
||||
FROM maven:3.9.6-eclipse-temurin-17 AS build
|
||||
WORKDIR /build
|
||||
|
||||
# Copy pom.xml and download dependencies
|
||||
COPY pom.xml .
|
||||
RUN mvn dependency:go-offline -B
|
||||
|
||||
# Copy source code
|
||||
COPY src ./src
|
||||
|
||||
# Build application
|
||||
RUN mvn clean package -DskipTests -Pproduction
|
||||
|
||||
## Stage 2 : Create runtime image
|
||||
FROM registry.access.redhat.com/ubi8/openjdk-17-runtime:1.18
|
||||
|
||||
ENV LANGUAGE='en_US:en'
|
||||
|
||||
# We make four distinct layers so if there are application changes the library layers can be re-used
|
||||
COPY --from=build --chown=185 /build/target/quarkus-app/lib/ /deployments/lib/
|
||||
COPY --from=build --chown=185 /build/target/quarkus-app/*.jar /deployments/
|
||||
COPY --from=build --chown=185 /build/target/quarkus-app/app/ /deployments/app/
|
||||
COPY --from=build --chown=185 /build/target/quarkus-app/quarkus/ /deployments/quarkus/
|
||||
|
||||
EXPOSE 8080
|
||||
USER 185
|
||||
|
||||
ENV JAVA_OPTS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
|
||||
ENV JAVA_APP_JAR="/deployments/quarkus-run.jar"
|
||||
|
||||
ENTRYPOINT [ "java", "-jar", "/deployments/quarkus-run.jar" ]
|
||||
|
||||
Reference in New Issue
Block a user