From 992419f769095a223b8de0b2d0ff7a6d33baeec9 Mon Sep 17 00:00:00 2001 From: Suraj Date: Fri, 9 May 2025 16:13:54 +0530 Subject: [PATCH 1/3] feat: add Dockerfile and update pom.xml plugin for repackage --- Dockerfile | 22 ++++++++++++++++++++++ pom.xml | 12 ++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..29e04fd --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +# --- Stage 1: Build the application using Maven --- +FROM maven:3.9.6-eclipse-temurin-17 AS build + +WORKDIR /app + +COPY . . + +# Build the application while caching Maven dependencies to speed up future builds +RUN --mount=type=cache,target=/root/.m2 \ + mvn clean package -DENV_VAR=ci -DskipTests -Dgit.skip=true + +# --- Stage 2: Run the application with a minimal JRE image --- +FROM eclipse-temurin:17-jre + +WORKDIR /app + +# Copy the built WAR file from the build stage +COPY --from=build /app/target/*.war app.war + +EXPOSE 8080 + +ENTRYPOINT ["java", "-jar", "app.war"] diff --git a/pom.xml b/pom.xml index 84d6d8b..c168c47 100644 --- a/pom.xml +++ b/pom.xml @@ -392,6 +392,18 @@ + + org.springframework.boot + spring-boot-maven-plugin + 3.2.2 + + + + repackage + + + + From c8cd66a4c0f9e6dd8f3ae7c4d48954fd2214736b Mon Sep 17 00:00:00 2001 From: Suraj Date: Tue, 27 May 2025 17:38:52 +0530 Subject: [PATCH 2/3] chore: update Dockerfile and add seperate docker properties file --- Dockerfile | 2 +- src/main/environment/common_ci.properties | 1 - src/main/environment/common_docker.properties | 24 +++++++++++++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 src/main/environment/common_docker.properties diff --git a/Dockerfile b/Dockerfile index 29e04fd..f99697f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ COPY . . # Build the application while caching Maven dependencies to speed up future builds RUN --mount=type=cache,target=/root/.m2 \ - mvn clean package -DENV_VAR=ci -DskipTests -Dgit.skip=true + mvn clean package -DENV_VAR=docker -DskipTests -Dgit.skip=true # --- Stage 2: Run the application with a minimal JRE image --- FROM eclipse-temurin:17-jre diff --git a/src/main/environment/common_ci.properties b/src/main/environment/common_ci.properties index 6e7d5de..3912622 100644 --- a/src/main/environment/common_ci.properties +++ b/src/main/environment/common_ci.properties @@ -24,4 +24,3 @@ logging.file.name=@env.SCHEDULER_API_LOGGING_FILE_NAME@ springdoc.api-docs.enabled=@env.SWAGGER_DOC_ENABLED@ springdoc.swagger-ui.enabled=@env.SWAGGER_DOC_ENABLED@ - diff --git a/src/main/environment/common_docker.properties b/src/main/environment/common_docker.properties new file mode 100644 index 0000000..19c6315 --- /dev/null +++ b/src/main/environment/common_docker.properties @@ -0,0 +1,24 @@ +# local env +# DB Connections +spring.datasource.url=${DATABASE_URL} +spring.datasource.username=${DATABASE_USERNAME} +spring.datasource.password=${DATABASE_PASSWORD} +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver + +spring.jpa.show-sql=true + +spring.profiles.active=test + +callcentre-server-ip=${CALLCENTRE_SERVER_IP} + +common-url=${COMMON_API} + +### Redis IP +spring.redis.host=localhost +jwt.secret=${JWT_SECRET_KEY} + +#ELK logging file name +logging.file.name=${SCHEDULER_API_LOGGING_FILE_NAME} + +springdoc.api-docs.enabled=${SWAGGER_DOC_ENABLED} +springdoc.swagger-ui.enabled=${SWAGGER_DOC_ENABLED} From 4e26153d6cbff911d4358aaa3978d17b9c0db867 Mon Sep 17 00:00:00 2001 From: Mithun James <1007084+drtechie@users.noreply.github.com> Date: Tue, 17 Jun 2025 12:30:43 +0530 Subject: [PATCH 3/3] fix: add missing TM and FHIR APIS --- src/main/environment/common_ci.properties | 2 +- src/main/environment/common_docker.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/environment/common_ci.properties b/src/main/environment/common_ci.properties index a9918f5..9c52794 100644 --- a/src/main/environment/common_ci.properties +++ b/src/main/environment/common_ci.properties @@ -15,7 +15,7 @@ callcentre-server-ip=@env.CALLCENTRE_SERVER_IP@ common-url=@env.COMMON_API@ ### Redis IP -spring.redis.host=localhost +spring.redis.host=@env.REDIS_HOST@ jwt.secret=@env.JWT_SECRET_KEY@ #ELK logging file name diff --git a/src/main/environment/common_docker.properties b/src/main/environment/common_docker.properties index 19c6315..2a14eb1 100644 --- a/src/main/environment/common_docker.properties +++ b/src/main/environment/common_docker.properties @@ -14,7 +14,7 @@ callcentre-server-ip=${CALLCENTRE_SERVER_IP} common-url=${COMMON_API} ### Redis IP -spring.redis.host=localhost +spring.redis.host=${REDIS_HOST} jwt.secret=${JWT_SECRET_KEY} #ELK logging file name