-
Notifications
You must be signed in to change notification settings - Fork 31
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
c36cd7a
commit db9c1a2
Showing
7 changed files
with
83 additions
and
44 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
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
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,40 +1,22 @@ | ||
FROM maven:3.9.6-eclipse-temurin-21-alpine AS build | ||
FROM bellsoft/liberica-runtime-container:jdk-21-stream-musl as builder | ||
LABEL authors="hendisantika" | ||
|
||
RUN mkdir /project | ||
|
||
COPY . /project | ||
|
||
# Passed from Github Actions | ||
ARG GIT_VERSION_TAG=unspecified | ||
ARG GIT_COMMIT_MESSAGE=unspecified | ||
ARG GIT_VERSION_HASH=unspecified | ||
|
||
WORKDIR /project | ||
|
||
# You can read these files for the information in your application | ||
RUN echo $GIT_VERSION_TAG > GIT_VERSION_TAG.txt | ||
RUN echo $GIT_COMMIT_MESSAGE > GIT_COMMIT_MESSAGE.txt | ||
RUN echo $GIT_VERSION_HASH > GIT_VERSION_HASH.txt | ||
|
||
RUN mvn clean package | ||
|
||
#FROM adoptopenjdk/openjdk21:eclipse-temurin-21-alpine | ||
#FROM bellsoft/liberica-openjdk-debian:21 | ||
#FROM openjdk:21-slim | ||
FROM amazoncorretto:21-alpine-jdk | ||
LABEL maintainer="[email protected]" | ||
|
||
RUN mkdir /app | ||
|
||
RUN addgroup -g 1001 -S hendigroup | ||
|
||
RUN adduser -S hendi -u 1001 | ||
|
||
COPY --from=build /project/target/HikariCP-0.0.1.jar /app/HikariCP.jar | ||
|
||
WORKDIR /app | ||
|
||
RUN chown -R hendi:hendigroup /app | ||
|
||
CMD java $JAVA_OPTS -jar HikariCP.jar | ||
RUN cd /project/HikariCP && ./mvnw clean package | ||
#ADD hikaricp /home/myapp/hikaricp | ||
#RUN cd hikaricp && \ | ||
RUN ./mvnw clean package | ||
FROM bellsoft/alpaquita-linux-base:stream-musl-230404 | ||
RUN addgroup -S spring && adduser -S spring -G spring | ||
USER spring:spring | ||
VOLUME /tmp | ||
WORKDIR /home/myapp | ||
COPY --from=builder /project/HikariCP/target . | ||
EXPOSE 9000 | ||
CMD ["java", "-jar", "HikariCP-0.0.1.jar"] |
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 @@ | ||
#FROM eclipse-temurin:21-jre-alpine | ||
FROM maven:3.9.6-eclipse-temurin-21-alpine AS build | ||
|
||
## create a nonroot user and group | ||
RUN addgroup -S spring && adduser -S spring -G spring | ||
|
||
## copy the spring jar | ||
COPY target/*.jar /opt/myApp.jar | ||
|
||
## set the nonroot user as the default user | ||
USER spring:spring | ||
|
||
## set the working directory | ||
WORKDIR /opt | ||
|
||
ENTRYPOINT ["java", "-jar", "myApp.jar"] | ||
|
||
## expose the port to the external world | ||
EXPOSE 9000 |
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,40 @@ | ||
FROM maven:3.9.6-eclipse-temurin-21-alpine AS build | ||
LABEL authors="hendisantika" | ||
|
||
RUN mkdir /project | ||
|
||
COPY . /project | ||
|
||
# Passed from Github Actions | ||
ARG GIT_VERSION_TAG=unspecified | ||
ARG GIT_COMMIT_MESSAGE=unspecified | ||
ARG GIT_VERSION_HASH=unspecified | ||
|
||
WORKDIR /project | ||
|
||
# You can read these files for the information in your application | ||
RUN echo $GIT_VERSION_TAG > GIT_VERSION_TAG.txt | ||
RUN echo $GIT_COMMIT_MESSAGE > GIT_COMMIT_MESSAGE.txt | ||
RUN echo $GIT_VERSION_HASH > GIT_VERSION_HASH.txt | ||
|
||
RUN mvn clean package | ||
|
||
#FROM adoptopenjdk/openjdk21:eclipse-temurin-21-alpine | ||
#FROM bellsoft/liberica-openjdk-debian:21 | ||
#FROM openjdk:21-slim | ||
FROM amazoncorretto:21-alpine-jdk | ||
LABEL maintainer="[email protected]" | ||
|
||
RUN mkdir /app | ||
|
||
RUN addgroup -g 1001 -S hendigroup | ||
|
||
RUN adduser -S hendi -u 1001 | ||
|
||
COPY --from=build /project/target/HikariCP-0.0.1.jar /app/HikariCP.jar | ||
|
||
WORKDIR /app | ||
|
||
RUN chown -R hendi:hendigroup /app | ||
|
||
CMD java $JAVA_OPTS -jar HikariCP.jar |
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,8 @@ | ||
FROM amazoncorretto:21-alpine-jdk | ||
LABEL maintainer="[email protected]" | ||
VOLUME /tmp | ||
EXPOSE 9000 | ||
ARG JAR_FILE=target/*.jar | ||
COPY ${JAR_FILE} HikariCP-0.0.1.jar | ||
ENTRYPOINT ["java","-jar","HikariCP-0.0.1.jar"] | ||
|
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