-
Notifications
You must be signed in to change notification settings - Fork 1
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
14 additions
and
5 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 |
---|---|---|
@@ -1,5 +1,14 @@ | ||
FROM eclipse-temurin:17.0.7_7-jre | ||
WORKDIR /application | ||
RUN rm -rf /application | ||
ADD target/*.jar /application/app.jar | ||
ENTRYPOINT ["java", "-jar", "/application/app.jar"] | ||
FROM eclipse-temurin:21.0.2_13-jre-alpine | ||
|
||
WORKDIR /opt/app/ | ||
COPY ./target/*.jar /opt/app/app.jar | ||
|
||
# Setup a non-root user context (security) | ||
RUN addgroup -g 1000 tomcatgroup | ||
RUN adduser -D -s / -u 1000 tomcatuser -G tomcatgroup | ||
RUN mkdir /opt/app/temp-files | ||
RUN chown -R 1000:1000 /opt/app | ||
|
||
USER 1000 | ||
|
||
ENTRYPOINT ["java", "-jar", "/opt/app/app.jar"] |