Skip to content

Commit 4c695ca

Browse files
authored
Create Dockerfile
1 parent ea9dd65 commit 4c695ca

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Java 17 optimized image
2+
FROM bellsoft/liberica-runtime-container:jre-17-slim-musl
3+
4+
# Creates and switches to non-root user
5+
ENV APP_USER=app
6+
# Busybox syntax, which is available in the image
7+
RUN addgroup -S $APP_USER && adduser -D -g "" -G $APP_USER $APP_USER
8+
USER app
9+
10+
# Copy .jar to container
11+
ARG JAR_FILE=target/*.jar
12+
ENV APP_FOLDER=/opt/app
13+
WORKDIR $APP_FOLDER
14+
COPY $JAR_FILE app.jar
15+
16+
# Execute application
17+
ENTRYPOINT ["java", "-jar", "app.jar"]
18+
19+
EXPOSE 8080

0 commit comments

Comments
 (0)