From 12c757abdd74b32f7568daa7acdd40e467792cb8 Mon Sep 17 00:00:00 2001 From: Suraj Date: Fri, 9 May 2025 15:16:28 +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 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 06d66d8..f9aea27 100644 --- a/pom.xml +++ b/pom.xml @@ -451,6 +451,18 @@ + + org.springframework.boot + spring-boot-maven-plugin + 3.2.2 + + + + repackage + + + + From f3a9e9d0649c7e22bc2df325dcde40d30ab6b3a2 Mon Sep 17 00:00:00 2001 From: Suraj Date: Tue, 27 May 2025 15:24:03 +0530 Subject: [PATCH 2/4] chore: update Dockerfile and add seperate docker properties file --- Dockerfile | 2 +- src/main/environment/common_docker.properties | 113 ++++++++++++++++++ 2 files changed, 114 insertions(+), 1 deletion(-) 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_docker.properties b/src/main/environment/common_docker.properties new file mode 100644 index 0000000..be5dba8 --- /dev/null +++ b/src/main/environment/common_docker.properties @@ -0,0 +1,113 @@ +benSearchByBenIDURL=${COMMON_API_BASE_URL}/beneficiary/searchUserByID +userAuthURL=${COMMON_API_BASE_URL}/user/userAuthenticate + +# E-aushadhi +eaushadhiStoreStockDetailsUrl=${EAUSHADHI_URL}/rest/storeStockDetailsService/ +eaushadhiStoreStockAckUrl=${EAUSHADHI_URL}/rest/AcknowledgeStoreStockService/ + +fhirUserName=${FHIR_USER_NAME} +fhirPassword=${FHIR_PASSWORD} + +# DB Connections (MySQL) +spring.datasource.url=${DATABASE_URL} +spring.datasource.username=${DATABASE_USERNAME} +spring.datasource.password=${DATABASE_PASSWORD} +spring.datasource.driver-class-name=com.mysql.jdbc.Driver + +# DB Connection (Mongo DB) +spring.data.mongodb.host=${MONGO_HOST} +spring.data.mongodb.port=27017 +spring.data.mongodb.authentication-database=${MONGO_AUTH_DBNAME} +spring.data.mongodb.database=${MONGO_DBNAME} +spring.data.mongodb.username=${MONGO_USERNAME} +spring.data.mongodb.password=${MONGO_PASSWORD} + +atomsFeedStartPage=1 +parentUrl=${BAHMINI_URL} + +atomFeedURLPatientDemographic=/openmrs/ws/atomfeed/patient/ +atomFeedURLPatientEncounter=/openmrs/ws/atomfeed/encounter/ + +feedAuthUserName=${FEED_AUTH_URL} +feedAuthPassword=${FEED_AUTH_PASSWORD} + +eAushadhiDummy=yes + +##NDHM ABHA API +clientID=${NDHM_ABHA_CLIENT_ID} +clientSecret=${NDHM_ABHA_CLIENT_SECRET_KEY} + +##Default ABDM Facility ID +abdmFacilityId=${ABDM_FACILITY_ID} + +ndhmuserAuthenticate=${ABDM_BASE_URL}/gateway/v0.5/sessions +ndhmGenerateOTP=${ABDM_HEALTH_ID_BASE_URL}/api/v1/registration/mobile/generateOtp +ndhmVerifyOTP=${ABDM_HEALTH_ID_BASE_URL}/api/v1/registration/mobile/verifyOtp +ndhmCreateHealthID=${ABDM_HEALTH_ID_BASE_URL}/api/v1/registration/mobile/createHealthId + +## ABHA with aadhaar +ndhmGenerateOTPWithAadhaar=${ABDM_HEALTH_ID_BASE_URL}/api/v1/registration/aadhaar/generateOtp +ndhmCreateHealthIDWithAadhaar=${ABDM_HEALTH_ID_BASE_URL}/api/v1/registration/aadhaar/createHealthIdWithAadhaarOtp + +## ABHA Creation New APIs +abdmVerifyOTP=${ABDM_HEALTH_ID_BASE_URL}/api/v1/registration/aadhaar/verifyOTP +abdmCheckAndGenerateMobileOTP=${ABDM_HEALTH_ID_BASE_URL}/api/v2/registration/aadhaar/checkAndGenerateMobileOTP +abdmVerifyMobileOTP=${ABDM_HEALTH_ID_BASE_URL}/api/v1/registration/aadhaar/verifyMobileOTP +abdmcreateHealthIdWithPreVerified=${ABDM_HEALTH_ID_BASE_URL}/api/v1/registration/aadhaar/createHealthIdWithPreVerified + +##CareContext Creation API +generateOTPForCareContext=${ABDM_BASE_URL}/gateway/v0.5/users/auth/init +addCareContext=${ABDM_BASE_URL}/gateway/v0.5/links/link/add-contexts +validateOTPForCareContext=${ABDM_BASE_URL}/gateway/v0.5/users/auth/confirm + +##ABHA Card API +## Auth init - aadhar / mobile +generateOTP_ForCard=${ABDM_HEALTH_ID_BASE_URL}/api/v1/auth/init +## confirm with mobile OTP +verifyOTP_ForCard=${ABDM_HEALTH_ID_BASE_URL}/api/v1/auth/confirmWithMobileOTP +## confirm with Aadhaar +verifyOTP_ForCard_Aadhaar=${ABDM_HEALTH_ID_BASE_URL}/api/v1/auth/confirmWithAadhaarOtp +## print ABHA card - PNG +generateHealthCard=${ABDM_HEALTH_ID_BASE_URL}/api/v1/health/facility/getPngCard +generateHealthIDCard=${ABDM_HEALTH_ID_BASE_URL}/api/v1/account/getPngCard + +## Generate Notify SMS once episode completed +generateABDM_NotifySMS=${ABDM_BASE_URL}/gateway/v1/patients/sms/notify2 + +##verifyBio +abdmVerifyBio=${ABDM_HEALTH_ID_BASE_URL}/api/v1/registration/aadhaar/verifyBio +abdmGenerateMobileOTP=${ABDM_HEALTH_ID_BASE_URL}/api/v1/registration/aadhaar/generateMobileOTP +abdmConfirmAadhaarBio=${ABDM_HEALTH_ID_BASE_URL}/api/v1/auth/confirmWithAadhaarBio +abdmAccountProfile=${ABDM_Account_ID_BASE_URL}/api/v1/account/profile + +##ABDM Facility services +getAbdmFacilityServicies=${ABDM_BASE_URL}/api/hiecm/gateway/v3/bridge-services + +##ABDM V3 APIs +abdmV3UserAuthenticate=${ABDM_BASE_URL}/api/hiecm/gateway/v3/sessions +getAuthCertPublicKey=${ABDM_HEALTH_ID_BASE_URL}/api/v1/auth/cert +requestOtpForEnrollment=${ABDM_BASE_URL}/abha/api/v3/enrollment/request/otp +abhaEnrollByAadhaar=${ABDM_BASE_URL}/abha/api/v3/enrollment/enrol/byAadhaar +printAbhaCard=${ABDM_BASE_URL}/abha/api/v3/profile/account/abha-card +abhaLoginRequestOtp=${ABDM_BASE_URL}/abha/api/v3/profile/login/request/otp +verifyAbhaLogin=${ABDM_BASE_URL}/abha/api/v3/profile/login/verify +abhaProfileLoginVerifyUser=${ABDM_BASE_URL}/abha/api/v3/profile/login/verify/user +requestAuthByAbdm=${ABDM_BASE_URL}/abha/api/v3/enrollment/auth/byAbdm +webLoginAbhaRequestOtp=${ABDM_BASE_URL}/abha/api/v3/phr/web/login/abha/request/otp +webLoginAbhaVerify=${ABDM_BASE_URL}/abha/api/v3/phr/web/login/abha/verify +webLoginAbhaVerify=${ABDM_BASE_URL}/abha/api/v3/phr/web/login/abha/verify +webLoginPhrCard=${ABDM_BASE_URL}/abha/api/v3/phr/web/login/profile/abha/phr-card + +x-CM-ID=sbx +abhaMode=sbx + +#logging.pattern.level=DEBUG +logging.level.root=INFO +logging.level.org.springframework.web=INFO +logging.level.org.hibernate=INFO +logging.level.com.iemr=DEBUG +logging.level.org.springframework=INFO + +#ELK logging file name +logging.file.name=${FHIR_API_LOGGING_FILE_NAME} +jwt.secret=${JWT_SECRET_KEY} From 4be81db3e12d53d59bb559d0369ba1acb2632b48 Mon Sep 17 00:00:00 2001 From: Mithun James <1007084+drtechie@users.noreply.github.com> Date: Wed, 11 Jun 2025 15:06:06 +0530 Subject: [PATCH 3/4] fix: change ABDM URLs in docker env properties --- src/main/environment/common_docker.properties | 56 ++++++++++--------- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/src/main/environment/common_docker.properties b/src/main/environment/common_docker.properties index be5dba8..8d3fc25 100644 --- a/src/main/environment/common_docker.properties +++ b/src/main/environment/common_docker.properties @@ -1,5 +1,5 @@ -benSearchByBenIDURL=${COMMON_API_BASE_URL}/beneficiary/searchUserByID -userAuthURL=${COMMON_API_BASE_URL}/user/userAuthenticate +benSearchByBenIDURL=${COMMON_API_BASE_URL}beneficiary/searchUserByID +userAuthURL=${COMMON_API_BASE_URL}user/userAuthenticate # E-aushadhi eaushadhiStoreStockDetailsUrl=${EAUSHADHI_URL}/rest/storeStockDetailsService/ @@ -38,7 +38,7 @@ clientID=${NDHM_ABHA_CLIENT_ID} clientSecret=${NDHM_ABHA_CLIENT_SECRET_KEY} ##Default ABDM Facility ID -abdmFacilityId=${ABDM_FACILITY_ID} +abdmFacilityId= ${ABDM_FACILITY_ID} ndhmuserAuthenticate=${ABDM_BASE_URL}/gateway/v0.5/sessions ndhmGenerateOTP=${ABDM_HEALTH_ID_BASE_URL}/api/v1/registration/mobile/generateOtp @@ -50,14 +50,15 @@ ndhmGenerateOTPWithAadhaar=${ABDM_HEALTH_ID_BASE_URL}/api/v1/registration/aadhaa ndhmCreateHealthIDWithAadhaar=${ABDM_HEALTH_ID_BASE_URL}/api/v1/registration/aadhaar/createHealthIdWithAadhaarOtp ## ABHA Creation New APIs -abdmVerifyOTP=${ABDM_HEALTH_ID_BASE_URL}/api/v1/registration/aadhaar/verifyOTP -abdmCheckAndGenerateMobileOTP=${ABDM_HEALTH_ID_BASE_URL}/api/v2/registration/aadhaar/checkAndGenerateMobileOTP -abdmVerifyMobileOTP=${ABDM_HEALTH_ID_BASE_URL}/api/v1/registration/aadhaar/verifyMobileOTP -abdmcreateHealthIdWithPreVerified=${ABDM_HEALTH_ID_BASE_URL}/api/v1/registration/aadhaar/createHealthIdWithPreVerified +abdmVerifyOTP= ${ABDM_HEALTH_ID_BASE_URL}/api/v1/registration/aadhaar/verifyOTP +abdmCheckAndGenerateMobileOTP= ${ABDM_HEALTH_ID_BASE_URL}/api/v2/registration/aadhaar/checkAndGenerateMobileOTP +abdmVerifyMobileOTP= ${ABDM_HEALTH_ID_BASE_URL}/api/v1/registration/aadhaar/verifyMobileOTP +abdmcreateHealthIdWithPreVerified= ${ABDM_HEALTH_ID_BASE_URL}/api/v1/registration/aadhaar/createHealthIdWithPreVerified + ##CareContext Creation API generateOTPForCareContext=${ABDM_BASE_URL}/gateway/v0.5/users/auth/init -addCareContext=${ABDM_BASE_URL}/gateway/v0.5/links/link/add-contexts +addCareContext = ${ABDM_BASE_URL}/gateway/v0.5/links/link/add-contexts validateOTPForCareContext=${ABDM_BASE_URL}/gateway/v0.5/users/auth/confirm ##ABHA Card API @@ -78,28 +79,27 @@ generateABDM_NotifySMS=${ABDM_BASE_URL}/gateway/v1/patients/sms/notify2 abdmVerifyBio=${ABDM_HEALTH_ID_BASE_URL}/api/v1/registration/aadhaar/verifyBio abdmGenerateMobileOTP=${ABDM_HEALTH_ID_BASE_URL}/api/v1/registration/aadhaar/generateMobileOTP abdmConfirmAadhaarBio=${ABDM_HEALTH_ID_BASE_URL}/api/v1/auth/confirmWithAadhaarBio -abdmAccountProfile=${ABDM_Account_ID_BASE_URL}/api/v1/account/profile +abdmAccountProfile=${ABDM_ACCOUNT_ID_BASE_URL}/api/v1/account/profile ##ABDM Facility services -getAbdmFacilityServicies=${ABDM_BASE_URL}/api/hiecm/gateway/v3/bridge-services +getAbdmFacilityServicies= ${ABDM_HIECM_BASE_URL}/api/hiecm/gateway/v3/bridge-services ##ABDM V3 APIs -abdmV3UserAuthenticate=${ABDM_BASE_URL}/api/hiecm/gateway/v3/sessions -getAuthCertPublicKey=${ABDM_HEALTH_ID_BASE_URL}/api/v1/auth/cert -requestOtpForEnrollment=${ABDM_BASE_URL}/abha/api/v3/enrollment/request/otp -abhaEnrollByAadhaar=${ABDM_BASE_URL}/abha/api/v3/enrollment/enrol/byAadhaar -printAbhaCard=${ABDM_BASE_URL}/abha/api/v3/profile/account/abha-card -abhaLoginRequestOtp=${ABDM_BASE_URL}/abha/api/v3/profile/login/request/otp -verifyAbhaLogin=${ABDM_BASE_URL}/abha/api/v3/profile/login/verify -abhaProfileLoginVerifyUser=${ABDM_BASE_URL}/abha/api/v3/profile/login/verify/user -requestAuthByAbdm=${ABDM_BASE_URL}/abha/api/v3/enrollment/auth/byAbdm -webLoginAbhaRequestOtp=${ABDM_BASE_URL}/abha/api/v3/phr/web/login/abha/request/otp -webLoginAbhaVerify=${ABDM_BASE_URL}/abha/api/v3/phr/web/login/abha/verify -webLoginAbhaVerify=${ABDM_BASE_URL}/abha/api/v3/phr/web/login/abha/verify -webLoginPhrCard=${ABDM_BASE_URL}/abha/api/v3/phr/web/login/profile/abha/phr-card - -x-CM-ID=sbx -abhaMode=sbx +abdmV3UserAuthenticate = ${ABDM_HIECM_BASE_URL}/api/hiecm/gateway/v3/sessions +getAuthCertPublicKey = ${ABDM_ABHA_V3_URL}/v3/profile/public/certificate +requestOtpForEnrollment = ${ABDM_ABHA_V3_URL}/v3/enrollment/request/otp +abhaEnrollByAadhaar = ${ABDM_ABHA_V3_URL}/v3/enrollment/enrol/byAadhaar +printAbhaCard = ${ABDM_ABHA_V3_URL}/v3/profile/account/abha-card +abhaLoginRequestOtp = ${ABDM_ABHA_V3_URL}/v3/profile/login/request/otp +verifyAbhaLogin = ${ABDM_ABHA_V3_URL}/v3/profile/login/verify +abhaProfileLoginVerifyUser = ${ABDM_ABHA_V3_URL}/v3/profile/login/verify/user +requestAuthByAbdm = ${ABDM_ABHA_V3_URL}/v3/enrollment/auth/byAbdm +webLoginAbhaRequestOtp = ${ABDM_PHR_URL}/login/abha/request/otp +webLoginAbhaVerify = ${ABDM_PHR_URL}/login/abha/verify +webLoginPhrCard = ${ABDM_PHR_URL}/login/profile/abha/phr-card + +x-CM-ID=${X_CM_ID} +abhaMode=${ABHA_MODE} #logging.pattern.level=DEBUG logging.level.root=INFO @@ -109,5 +109,9 @@ logging.level.com.iemr=DEBUG logging.level.org.springframework=INFO #ELK logging file name +logging.path=logs/ logging.file.name=${FHIR_API_LOGGING_FILE_NAME} jwt.secret=${JWT_SECRET_KEY} + +springdoc.api-docs.enabled=${SWAGGER_DOC_ENABLED} +springdoc.swagger-ui.enabled=${SWAGGER_DOC_ENABLED} From a3dcec85aebc9fc3cf4966bb45d293a2fcb2b600 Mon Sep 17 00:00:00 2001 From: Mithun James <1007084+drtechie@users.noreply.github.com> Date: Tue, 17 Jun 2025 12:20:09 +0530 Subject: [PATCH 4/4] fix: move redis host to env variable --- src/main/environment/common_ci.properties | 3 +++ src/main/environment/common_docker.properties | 3 +++ src/main/resources/application.properties | 1 - 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/environment/common_ci.properties b/src/main/environment/common_ci.properties index e0acf3b..c5dd779 100644 --- a/src/main/environment/common_ci.properties +++ b/src/main/environment/common_ci.properties @@ -115,3 +115,6 @@ jwt.secret=@env.JWT_SECRET_KEY@ springdoc.api-docs.enabled=@env.SWAGGER_DOC_ENABLED@ springdoc.swagger-ui.enabled=@env.SWAGGER_DOC_ENABLED@ + +# Redis IP +spring.redis.host=@env.REDIS_HOST@ \ No newline at end of file diff --git a/src/main/environment/common_docker.properties b/src/main/environment/common_docker.properties index 8d3fc25..82239d6 100644 --- a/src/main/environment/common_docker.properties +++ b/src/main/environment/common_docker.properties @@ -115,3 +115,6 @@ jwt.secret=${JWT_SECRET_KEY} springdoc.api-docs.enabled=${SWAGGER_DOC_ENABLED} springdoc.swagger-ui.enabled=${SWAGGER_DOC_ENABLED} + +# Redis IP +spring.redis.host=${REDIS_HOST} \ No newline at end of file diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index e3f3cd8..425febb 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -27,7 +27,6 @@ spring.jpa.hibernate.format_sql=true spring.session.store-type=redis -spring.redis.host=localhost spring.redis.password= spring.redis.port=6379 ## Below values are needed for extending the expiry time and extend expiry time.