-
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
Showing
1 changed file
with
19 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,19 @@ | ||
# Java 17 optimized image | ||
FROM bellsoft/liberica-runtime-container:jre-17-slim-musl | ||
|
||
# Creates and switches to non-root user | ||
ENV APP_USER=app | ||
# Busybox syntax, which is available in the image | ||
RUN addgroup -S $APP_USER && adduser -D -g "" -G $APP_USER $APP_USER | ||
USER app | ||
|
||
# Copy .jar to container | ||
ARG JAR_FILE=target/*.jar | ||
ENV APP_FOLDER=/opt/app | ||
WORKDIR $APP_FOLDER | ||
COPY $JAR_FILE app.jar | ||
|
||
# Execute application | ||
ENTRYPOINT ["java", "-jar", "app.jar"] | ||
|
||
EXPOSE 8080 |