forked from arjungautam1/fullstack-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
858abe9
commit b044de3
Showing
5 changed files
with
66 additions
and
12 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,11 @@ | ||
# Build demoapp-backend using dockerfile-maven-plugin: https://github.com/spotify/dockerfile-maven | ||
|
||
ARG RUNTIME_IMAGE="registry.access.redhat.com/ubi8/openjdk-17-runtime" | ||
FROM ${RUNTIME_IMAGE} | ||
WORKDIR /app | ||
|
||
# Add the service itself | ||
ARG JAR_FILE | ||
COPY target/${JAR_FILE} demoapp-backend.jar | ||
|
||
CMD ["/usr/bin/java", "-jar", "/app/demoapp-backend.jar"] |
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 |
---|---|---|
@@ -1,18 +1,19 @@ | ||
# Build demoapp-backend using Multi-Stage Container Build | ||
# Build demoapp-backend using Multi-Stage Container Build: https://docs.docker.com/build/building/multi-stage/ | ||
|
||
ARG BUILD_IMAGE="registry.access.redhat.com/ubi8/openjdk-17" | ||
ARG RUNTIME_IMAGE="registry.access.redhat.com/ubi8/openjdk-17-runtime" | ||
ARG MAVEN_ARGS="-Dmaven.test.skip=true" | ||
|
||
# Build | ||
FROM ${BUILD_IMAGE} as build | ||
ARG MAVEN_ARGS | ||
WORKDIR /build | ||
|
||
COPY src ./src | ||
COPY pom.xml ./pom.xml | ||
RUN mvn "${MAVEN_ARGS[@]}" clean package | ||
RUN mvn clean package -Dmaven.test.skip=true -Ddockerfile.skip | ||
|
||
# APP | ||
FROM ${RUNTIME_IMAGE} | ||
COPY --from=build /home/jboss/target/demoapp-backend*.jar demoapp-backend.jar | ||
CMD ["/usr/bin/java", "-jar", "demoapp-backend.jar"] | ||
WORKDIR /app | ||
COPY --from=build /build/target/demoapp-backend*.jar demoapp-backend.jar | ||
CMD ["/usr/bin/java", "-jar", "/app/demoapp-backend.jar"] |
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
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
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