-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds Dockerfile that gets the supervisor out of the picture
- Loading branch information
1 parent
72a3923
commit 6e32b6e
Showing
1 changed file
with
27 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,27 @@ | ||
# Use the official Maven image as the base image | ||
FROM maven:latest AS build | ||
|
||
# Set the working directory to /app | ||
WORKDIR /app | ||
|
||
# Copy the pom.xml file and install the dependencies | ||
COPY pom.xml . | ||
RUN mvn dependency:resolve | ||
|
||
# Copy the source code and build the JAR file | ||
COPY src/ /app/src/ | ||
RUN mvn clean package assembly:single | ||
|
||
RUN ls /app/target | ||
|
||
# Use the official OpenJDK image as the base image for the final image | ||
FROM openjdk:latest AS final | ||
|
||
# Set the working directory to /app | ||
WORKDIR /app | ||
|
||
# Copy the JAR file from the Maven image to the final image | ||
COPY --from=build /app/target/misbehavingjmxserver-1.0-SNAPSHOT-jar-with-dependencies.jar . | ||
|
||
# Run the supervisor class from the jar | ||
CMD ["java", "-cp", "misbehavingjmxserver-1.0-SNAPSHOT-jar-with-dependencies.jar", "org.datadog.misbehavingjmxserver.App"] |