-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Start with a base image containing Maven | ||
FROM maven:3.8.3-openjdk-17-slim AS build | ||
|
||
# Set the working directory in the container | ||
WORKDIR /app | ||
|
||
# Copy the project source | ||
COPY . . | ||
|
||
# Build the project | ||
RUN mvn clean package | ||
|
||
# Use Red Hat's OpenJDK 17 as base image | ||
FROM registry.access.redhat.com/ubi8/openjdk-17:1.14 | ||
|
||
# Set environment variables | ||
ENV LANG='en_US.UTF-8' 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 /app/target/quarkus-app/lib/ /deployments/lib/ | ||
COPY --from=build --chown=185 /app/target/quarkus-app/*.jar /deployments/ | ||
COPY --from=build --chown=185 /app/target/quarkus-app/app/ /deployments/app/ | ||
COPY --from=build --chown=185 /app/target/quarkus-app/quarkus/ /deployments/quarkus/ | ||
|
||
# Expose port | ||
EXPOSE 8081 | ||
|
||
# Set user | ||
USER 185 | ||
|
||
# Additional environment variables | ||
ENV AB_JOLOKIA_OFF="" | ||
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" |