Skip to content

Commit

Permalink
Update Dockerfile (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
BettyB979 authored Apr 4, 2024
1 parent f2df1d3 commit 5b86d81
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions Dockerfile
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"]

0 comments on commit 5b86d81

Please sign in to comment.