From a73ba143d4632148efa8febbe8f34bd07f19062d Mon Sep 17 00:00:00 2001 From: Suraj Date: Fri, 9 May 2025 16:11:46 +0530 Subject: [PATCH 1/4] 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 00000000..29e04fd5 --- /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 b94c7871..c6dd18ed 100644 --- a/pom.xml +++ b/pom.xml @@ -418,6 +418,18 @@ + + org.springframework.boot + spring-boot-maven-plugin + 3.2.2 + + + + repackage + + + + From 14da1c4b5352fed5aa20d8581a32d1d71218d80e Mon Sep 17 00:00:00 2001 From: Suraj Date: Tue, 27 May 2025 17:37:25 +0530 Subject: [PATCH 2/4] chore: update Dockerfile and add seperate docker properties file --- Dockerfile | 2 +- pom.xml | 20 ++--- src/main/environment/common_ci.properties | 2 +- src/main/environment/common_docker.properties | 86 +++++++++++++++++++ 4 files changed, 98 insertions(+), 12 deletions(-) create mode 100644 src/main/environment/common_docker.properties diff --git a/Dockerfile b/Dockerfile index 29e04fd5..f99697fa 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/pom.xml b/pom.xml index c6dd18ed..0804d99c 100644 --- a/pom.xml +++ b/pom.xml @@ -44,21 +44,21 @@ org.springframework.boot spring-boot-starter-aop + + org.springframework.boot + spring-boot-starter + + + org.springframework.boot + spring-boot-starter-logging + + + co.elastic.logging logback-ecs-encoder 1.3.2 - - org.slf4j - slf4j-api - ${slf4j.version} - - - org.slf4j - slf4j-simple - ${slf4j.version} - org.springdoc diff --git a/src/main/environment/common_ci.properties b/src/main/environment/common_ci.properties index 29a976b9..53e8f524 100644 --- a/src/main/environment/common_ci.properties +++ b/src/main/environment/common_ci.properties @@ -83,4 +83,4 @@ jwt.secret=@env.JWT_SECRET_KEY@ logging.file.name=@env.MMU_API_LOGGING_FILE_NAME@ springdoc.api-docs.enabled=@env.SWAGGER_DOC_ENABLED@ -springdoc.swagger-ui.enabled=@env.SWAGGER_DOC_ENABLED@ +springdoc.swagger-ui.enabled=@env.SWAGGER_DOC_ENABLED@ \ No newline at end of file diff --git a/src/main/environment/common_docker.properties b/src/main/environment/common_docker.properties new file mode 100644 index 00000000..6cc4d7e4 --- /dev/null +++ b/src/main/environment/common_docker.properties @@ -0,0 +1,86 @@ +# 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.jdbc.Driver + +## Carestream URLs, local +carestreamOrderCreateURL=${COMMON_API_BASE_URL}/carestream/createOrder + +## Identity - Common URLs +# Registration +registrationUrl=${COMMON_API_BASE_URL}/beneficiary/createBeneficiary + +registrarQuickSearchByIdUrl=${COMMON_API_BASE_URL}/beneficiary/searchUserByID + +registrarQuickSearchByPhoneNoUrl=${COMMON_API_BASE_URL}/beneficiary/searchUserByPhone + +getBenImageFromIdentity=${IDENTITY_API_BASE_URL}/id/benImageByBenRegID + +beneficiaryEditUrl=${COMMON_API_BASE_URL}/beneficiary/updateBenefciaryDetails + +registrarAdvanceSearchUrl=${COMMON_API_BASE_URL}/beneficiary/searchBeneficiary + +## Data Sync API, central +dataSyncUploadUrl=${MMU_API_BASE_URL}/dataSync/van-to-server + +## Data download API, central +dataSyncDownloadUrl=${MMU_API_BASE_URL}/dataSync/server-to-van + +## TC specialist slot booking, # not required +tcSpecialistSlotBook=${TM_API_BASE_URL}/schedule/bookSlot + +## TC specialist slot cancelling, # not required +tcSpecialistSlotCancel=${TM_API_BASE_URL}/schedule/cancelBookedSlot + +## benGenUrl, common, central +benGenUrlCentral=${COMMON_API_BASE_URL}/beneficiary/generateBeneficiaryIDs + +## benImportUrl, identity, local +benImportUrlLocal=${IDENTITY_API_BASE_URL}/id/saveGeneratedBenIDToLocalServer +mmucentralserver=${MMU_CENTRAL_SERVER}/common/get/Case-sheet/centralServerTMCaseSheet + +tmCentralServer=${TM_CENTRAL_SERVER}/common/get/Case-sheet/printData + +specialistSign=${COMMON_API_BASE_URL}/signature1/getSignClass + +## inventory transaction download URL, central, mmu +dataSyncTransactionDownloadUrl=${MMU_API_BASE_URL}/dataSync/server-to-van-transactional + +## inventory transaction processed flag update URL, central, mmu +dataSyncProcessedFlagUpdate=${MMU_API_BASE_URL}/dataSync/updateProcessedFlagPostDownload + + +fileBasePath=${MMU_FILE_BASE_PATH} + +## data sync batch size +BATCH_SIZE=30 +snomedCTPageSize=10 +nurseWL=7 +docWL=7 +pharmaWL=7 +labWL=7 +radioWL=7 +oncoWL=7 + +## For File Sync +serverIP=${FILE_SYNC_SERVER_IP} +serverDomain=${FILE_SYNC_SERVER_DOMAIN} +serverUserName=${FILE_SYNC_SERVER_USERNAME} +serverPassword=${FILE_SYNC_SERVER_PASSWORD} +localFolderToSync=${LOCAL_FOLDER_TO_SYNC} +serverFolder=MMUSync +getServerCredentialURL=${MMU_API_BASE_URL}/fileSyncController/getServerCredential +tmReferCheckValue=TM + +### Redis IP +spring.redis.host=localhost + +jwt.secret=${JWT_SECRET_KEY} + +#ELK logging file name +logging.file.name=${MMU_API_LOGGING_FILE_NAME} + +springdoc.api-docs.enabled=${SWAGGER_DOC_ENABLED} +springdoc.swagger-ui.enabled=${SWAGGER_DOC_ENABLED} From 8b851125b222c5c8bcdf48a817a9d1631d4d29e9 Mon Sep 17 00:00:00 2001 From: Mithun James <1007084+drtechie@users.noreply.github.com> Date: Wed, 11 Jun 2025 15:37:17 +0530 Subject: [PATCH 3/4] fix: fix docker properties as per ci properties --- src/main/environment/common_docker.properties | 45 ++++++++++--------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/src/main/environment/common_docker.properties b/src/main/environment/common_docker.properties index 6cc4d7e4..0f7fb2b4 100644 --- a/src/main/environment/common_docker.properties +++ b/src/main/environment/common_docker.properties @@ -6,53 +6,53 @@ spring.datasource.password=${DATABASE_PASSWORD} spring.datasource.driver-class-name=com.mysql.jdbc.Driver ## Carestream URLs, local -carestreamOrderCreateURL=${COMMON_API_BASE_URL}/carestream/createOrder +carestreamOrderCreateURL=${COMMON_API}carestream/createOrder ## Identity - Common URLs # Registration -registrationUrl=${COMMON_API_BASE_URL}/beneficiary/createBeneficiary +registrationUrl =${COMMON_API}beneficiary/createBeneficiary -registrarQuickSearchByIdUrl=${COMMON_API_BASE_URL}/beneficiary/searchUserByID +registrarQuickSearchByIdUrl =${COMMON_API}beneficiary/searchUserByID -registrarQuickSearchByPhoneNoUrl=${COMMON_API_BASE_URL}/beneficiary/searchUserByPhone +registrarQuickSearchByPhoneNoUrl =${COMMON_API}beneficiary/searchUserByPhone -getBenImageFromIdentity=${IDENTITY_API_BASE_URL}/id/benImageByBenRegID +getBenImageFromIdentity =${IDENTITY_API_BASE_URL}id/benImageByBenRegID -beneficiaryEditUrl=${COMMON_API_BASE_URL}/beneficiary/updateBenefciaryDetails +beneficiaryEditUrl =${COMMON_API}beneficiary/updateBenefciaryDetails -registrarAdvanceSearchUrl=${COMMON_API_BASE_URL}/beneficiary/searchBeneficiary +registrarAdvanceSearchUrl =${COMMON_API}beneficiary/searchBeneficiary ## Data Sync API, central -dataSyncUploadUrl=${MMU_API_BASE_URL}/dataSync/van-to-server +dataSyncUploadUrl=${MMU_CENTRAL_SERVER}dataSync/van-to-server ## Data download API, central -dataSyncDownloadUrl=${MMU_API_BASE_URL}/dataSync/server-to-van +dataSyncDownloadUrl=${MMU_CENTRAL_SERVER}dataSync/server-to-van ## TC specialist slot booking, # not required -tcSpecialistSlotBook=${TM_API_BASE_URL}/schedule/bookSlot +tcSpecialistSlotBook=${TM_API}schedule/bookSlot ## TC specialist slot cancelling, # not required -tcSpecialistSlotCancel=${TM_API_BASE_URL}/schedule/cancelBookedSlot +tcSpecialistSlotCancel=${TM_API}schedule/cancelBookedSlot ## benGenUrl, common, central -benGenUrlCentral=${COMMON_API_BASE_URL}/beneficiary/generateBeneficiaryIDs +benGenUrlCentral=${COMMON_API_OPEN_SYNC}beneficiary/generateBeneficiaryIDs ## benImportUrl, identity, local -benImportUrlLocal=${IDENTITY_API_BASE_URL}/id/saveGeneratedBenIDToLocalServer -mmucentralserver=${MMU_CENTRAL_SERVER}/common/get/Case-sheet/centralServerTMCaseSheet +benImportUrlLocal=${IDENTITY_API_BASE_URL}id/saveGeneratedBenIDToLocalServer +mmucentralserver = ${MMU_CENTRAL_SERVER}common/get/Case-sheet/centralServerTMCaseSheet -tmCentralServer=${TM_CENTRAL_SERVER}/common/get/Case-sheet/printData +tmCentralServer = ${TM_CENTRAL_SERVER}common/get/Case-sheet/printData -specialistSign=${COMMON_API_BASE_URL}/signature1/getSignClass +specialistSign=${COMMON_API}signature1/getSignClass ## inventory transaction download URL, central, mmu -dataSyncTransactionDownloadUrl=${MMU_API_BASE_URL}/dataSync/server-to-van-transactional +dataSyncTransactionDownloadUrl=${MMU_CENTRAL_SERVER}dataSync/server-to-van-transactional ## inventory transaction processed flag update URL, central, mmu -dataSyncProcessedFlagUpdate=${MMU_API_BASE_URL}/dataSync/updateProcessedFlagPostDownload +dataSyncProcessedFlagUpdate=${MMU_CENTRAL_SERVER}dataSync/updateProcessedFlagPostDownload -fileBasePath=${MMU_FILE_BASE_PATH} +fileBasePath =${MMU_FILE_BASE_PATH} ## data sync batch size BATCH_SIZE=30 @@ -71,16 +71,17 @@ serverUserName=${FILE_SYNC_SERVER_USERNAME} serverPassword=${FILE_SYNC_SERVER_PASSWORD} localFolderToSync=${LOCAL_FOLDER_TO_SYNC} serverFolder=MMUSync -getServerCredentialURL=${MMU_API_BASE_URL}/fileSyncController/getServerCredential +getServerCredentialURL=${MMU_API}fileSyncController/getServerCredential tmReferCheckValue=TM - ### Redis IP spring.redis.host=localhost jwt.secret=${JWT_SECRET_KEY} + #ELK logging file name +logging.path=logs logging.file.name=${MMU_API_LOGGING_FILE_NAME} springdoc.api-docs.enabled=${SWAGGER_DOC_ENABLED} -springdoc.swagger-ui.enabled=${SWAGGER_DOC_ENABLED} +springdoc.swagger-ui.enabled=${SWAGGER_DOC_ENABLED} \ No newline at end of file From c797363c9b1bc8e2b7758349f2e60d396a115b1a Mon Sep 17 00:00:00 2001 From: Mithun James <1007084+drtechie@users.noreply.github.com> Date: Tue, 17 Jun 2025 12:30:04 +0530 Subject: [PATCH 4/4] 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 bb90b8ee..917183ad 100644 --- a/src/main/environment/common_ci.properties +++ b/src/main/environment/common_ci.properties @@ -74,7 +74,7 @@ serverFolder=MMUSync getServerCredentialURL=@env.MMU_API@fileSyncController/getServerCredential tmReferCheckValue=TM ### Redis IP -spring.redis.host=localhost +spring.redis.host=@env.REDIS_HOST@ jwt.secret=@env.JWT_SECRET_KEY@ diff --git a/src/main/environment/common_docker.properties b/src/main/environment/common_docker.properties index 0f7fb2b4..b9faf6ad 100644 --- a/src/main/environment/common_docker.properties +++ b/src/main/environment/common_docker.properties @@ -74,7 +74,7 @@ serverFolder=MMUSync getServerCredentialURL=${MMU_API}fileSyncController/getServerCredential tmReferCheckValue=TM ### Redis IP -spring.redis.host=localhost +spring.redis.host=${REDIS_HOST} jwt.secret=${JWT_SECRET_KEY}