-
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
ed7f19a
commit a80e06c
Showing
1 changed file
with
30 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,30 @@ | ||
# | ||
# Build | ||
# | ||
FROM maven:3.9.6-amazoncorretto-17-al2023@sha256:459be099faa25a32c06cd45ed1ef2bc9dbbf8a5414da4e72349459a1bb4d6166 AS buildtime | ||
|
||
WORKDIR /build | ||
COPY . . | ||
|
||
RUN mvn clean package -DskipTests | ||
|
||
# | ||
# Docker RUNTIME | ||
# | ||
FROM amazoncorretto:17-alpine3.20@sha256:1b1d0653d890ff313a1f7afadd1fd81f5ea742c9c48670d483b1bbccef98bb8b AS runtime | ||
|
||
RUN apk --no-cache add shadow | ||
RUN useradd --uid 10000 runner | ||
|
||
VOLUME /tmp | ||
WORKDIR /app | ||
|
||
COPY --from=buildtime /build/target/*.jar /app/app.jar | ||
# The agent is enabled at runtime via JAVA_TOOL_OPTIONS. | ||
ADD https://github.com/microsoft/ApplicationInsights-Java/releases/download/3.6.1/applicationinsights-agent-3.6.1.jar /app/applicationinsights-agent.jar | ||
|
||
RUN chown -R runner:runner /app | ||
|
||
USER 10000 | ||
|
||
ENTRYPOINT ["java","-jar","/app/app.jar"] |