Skip to content

Commit

Permalink
#146 - Setup CI/CD 5️⃣ 🫸🌀✏️📗 :octocat:🐧🐳
Browse files Browse the repository at this point in the history
  • Loading branch information
hendisantika committed Mar 13, 2024
1 parent db9c1a2 commit 3f79565
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 40 deletions.
39 changes: 18 additions & 21 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
FROM bellsoft/liberica-runtime-container:jdk-21-stream-musl as builder
LABEL authors="hendisantika"
RUN mkdir /project
COPY . /project
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 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 .
#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
CMD ["java", "-jar", "HikariCP-0.0.1.jar"]
19 changes: 0 additions & 19 deletions Dockerfile1

This file was deleted.

22 changes: 22 additions & 0 deletions Dockerfile4
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM bellsoft/liberica-runtime-container:jdk-21-stream-musl as builder
LABEL authors="hendisantika"
RUN mkdir /project
COPY . /project/HikariCP
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 #cd /project/HikariCP && ./mvnw clean package
ADD /project/HikariCP /project/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"]

0 comments on commit 3f79565

Please sign in to comment.