From d0baf20c92fb51e3c599f572de1b6bf11222ee5e Mon Sep 17 00:00:00 2001 From: Suraj Date: Fri, 9 May 2025 14:56:57 +0530 Subject: [PATCH 1/2] chore: add Dockerfile and update pom.xml for optimal docker image --- 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 47b0922d..5c5b11af 100644 --- a/pom.xml +++ b/pom.xml @@ -654,6 +654,18 @@ + + org.springframework.boot + spring-boot-maven-plugin + 3.2.2 + + + + repackage + + + + From b460053e3f390e5dd06f73c5ba6822c9a12f9119 Mon Sep 17 00:00:00 2001 From: Suraj Date: Tue, 27 May 2025 15:22:16 +0530 Subject: [PATCH 2/2] chore: update Dockerfile, pom.xml and CI properties; add docker properties file --- Dockerfile | 2 +- pom.xml | 4 + src/main/environment/common_ci.properties | 1 - src/main/environment/common_docker.properties | 163 ++++++++++++++++++ 4 files changed, 168 insertions(+), 2 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 5c5b11af..6f31f526 100644 --- a/pom.xml +++ b/pom.xml @@ -59,6 +59,10 @@ org.springframework.boot spring-boot-starter + + org.springframework.boot + spring-boot-starter-logging + org.springframework spring-core diff --git a/src/main/environment/common_ci.properties b/src/main/environment/common_ci.properties index 1f82e9ea..daf0af38 100644 --- a/src/main/environment/common_ci.properties +++ b/src/main/environment/common_ci.properties @@ -168,4 +168,3 @@ start-grievancedatasync-scheduler=false cron-scheduler-grievancedatasync=0 0/2 * * * ? - diff --git a/src/main/environment/common_docker.properties b/src/main/environment/common_docker.properties new file mode 100644 index 00000000..7ac48332 --- /dev/null +++ b/src/main/environment/common_docker.properties @@ -0,0 +1,163 @@ +# 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 + +secondary.datasource.username=${REPORTING_DATABASE_USERNAME} +secondary.datasource.password=${REPORTING_DATABASE_PASSWORD} +secondary.datasource.url=${REPORTING_DATABASE_URL} +secondary.datasource.driver-class-name=com.mysql.jdbc.Driver + +# KM config +km-base-url=${KM_API_BASE_URL}/OpenKM +km-base-path=${KM_API_BASE_PATH}/OpenKM + +# CTI Config +cti-server-ip=${CTI_SERVER_IP} +cti-logger_base_url=${CTI_SERVER_LOGGER_BASE}/logger + +# Identity Config +identity-api-url = ${IDENTITY_API_URL} +identity-1097-api-url = ${IDENTITY_1097_API_URL} + +#### SMS Configuration +send-sms=${SEND_SMS} +sendSMSUrl = ${SEND_SMS_URL} +source-address=${SMS_SOURCE_ADDRESS} +sms-username=${SMS_USERNAME} +sms-password=${SMS_PASSWORD} +send-message-url=${SMS_MESSAGE_URL} + +###SMS Scheduler configurations +start-sms-scheduler=false +cron-scheduler-sms=0 0/1 * * * ? * + +#### Email Configuration +send-email=${SEND_EMAIL} +spring.mail.host=${MAIL_HOST} +spring.mail.port=${MAIL_PORT} +spring.mail.username=${MAIL_USERNAME} +spring.mail.password=${MAIL_PASSWORD} +spring.mail.properties.mail.smtp.auth=true +spring.mail.properties.mail.smtp.starttls.enable=true + +###Email Scheduler configurations +start-email-scheduler=true +cron-scheduler-email=0 0/1 * * * ? * + +###cti data check with call detail report Scheduler +#Runs at everyday 12:10AM +start-ctidatacheck-scheduler=true +cron-scheduler-ctidatacheck=0 10 00 * * * + +### generate Beneficiary Config +genben-api= ${BEN_GEN_API_URL} + +### file Base Path +--------------------------- +fileBasePath =${MMU_FILE_BASE_PATH} + +### Redis IP +spring.redis.host=localhost + +##--------------------------------------------------------------------------------------------------------------- +###CTI data sync schedular +cz-duration=40 +##--------------------------------------------------------------------------------------------------------------- +## prescription template +TMprescriptionTemplate=TMPrescription +##--------------------------------------------------------------------------------------------------------------- +##duration for everwell calender +everwellCalendarDuration=15 + ##--------------------------------------------------------------------------------------------------------------- +##lonic variables +lonicPageSize=10 + ##--------------------------------------------------------------------------------------------------------------- +#snomedcti +snomedCTPageSize=10 +##--------------------------------------------------------------------------------------------------------------- +#call retry count +callRetryConfiguration=3 +##--------------------------------------------------------------------------------------------------------------- +#avni registration Duration +avniRegistrationLimit=7 + +#--------------------------NHM Agent Real Time Data---------------------------- +nhm.agent.real.time.data.url=${NHM_AGENT_REAL_TIME_DATA_URL} +nhm.agent.real.time.data.cron.scheduler=0 */2 * ? * * +nhm.agent.real.time.data.cron.flag=true + +##missing commits + +carestream_socket_ip = ${CARESTREAM_SOCKET_IP} +carestream_socket_port = ${CARESTREAM_SOCKET_PORT} + +## everwell variables +everwellUserName = ${EVERWELL_USERNAME} +everwellPassword = ${EVERWELL_PASSWORD} +amritUserName = ${EVERWELL_AMRIT_USERNAME} +amritPassword = ${EVERWELL_AMRIT_PASSWORD} + +## everwell API call +everwellAddSupportAction = ${EVERWELL_BASE_URL}/Api/Patients/AddSupportAction +everwellEditDoses = ${EVERWELL_BASE_URL}/Api/Patients/EditManualDoses +everwellEditMissedDoses = ${EVERWELL_BASE_URL}/Api/Patients/EditMissedDoses +everwellGetPatientAdherenceUrl = ${EVERWELL_BASE_URL}/Api/Patients/CurrentMonthMissedAdherence?Page= +everwellEditSecondaryPhoneNo = ${EVERWELL_BASE_URL}/Api/Patients/EditPhoneNumber +everwell1097userAuthenticate = ${COMMON_API_BASE_URL}/user/userAuthenticate +everwelluserAuthenticate = ${EVERWELL_BASE_URL}/token +everwellRegisterBenficiary = ${COMMON_API_BASE_URL}/beneficiary/create + +## LungAssessment credentials +lungAssessmentEmail = ${SWAASA_EMAIL} +lungAssessmentPassword =${SWAASA_PASSWORD} + +## SWASSA APIs +lungAssessmentAdminLogin = ${SWAASA_BASE_URL}/api/adminLogin +lungAssessmentValidateCough = ${SWAASA_BASE_URL}/api/verifycough +lungAssessmentStartAssesment = ${SWAASA_BASE_URL}/api/assessment +lungAssessmentGetAssesment = ${SWAASA_BASE_URL}/api/getAssessment + +#E- Sanjeevani user authenticate creds +eSanjeevani.url: ${ESANJEEVANI_URL} +eSanjeevani.userName: ${ESANJEEVANI_USERNAME} +eSanjeevani.password: ${ESANJEEVANI_PASSWORD} +eSanjeevani.salt: ${ESANJEEVANI_SALT} +eSanjeevani.source: ${ESANJEEVANI_SOURCE} +eSanjeevani.registerPatient: ${ESANJEEVANI_REGISTER_PATIENT_URL} +eSanjeevani.routeUrl: ${ESANJEEVANI_ROUTE_URL} + +biometric.discover.url = ${BIOMETRIC_URL} +biometric.deviceInfo.url = ${BIOMETRIC_URL}/rd/info +biometric.capture.url = ${BIOMETRIC_URL}/rd/capture +eAusadhaUrl=https://dlc.kar.nic.in/e-services/api/DWInstituteInward + +eausadhaAuthorization= +spring.main.allow-bean-definition-overriding=true +spring.main.allow-circular-references=true + +jwt.secret=${JWT_SECRET_KEY} + +#ELK logging file name +logging.file.name=${COMMON_API_LOGGING_FILE_NAME} + +##grievance API call +updateGrievanceDetails = ${GRIEVANCE_API_BASE_URL}/grsbepro/igemr1097/public/api/v1/state-wise/grievance-list?page=PageNumber¤tpage=1 +updateGrievanceTransactionDetails=${GRIEVANCE_API_BASE_URL}/grsbepro/igemr1097/public/api/v1/grievance_details/ + +## grievance variables +grievanceUserName = ${GRIEVANCE_USERNAME} +grievancePassword = ${GRIEVANCE_PASSWORD} +grievanceUserAuthenticate = ${GRIEVANCE_USER_AUTHENTICATE} +grievanceDataSyncDuration = ${GRIEVANCE_DATA_SYNC_DURATION} + +springdoc.api-docs.enabled=false +springdoc.swagger-ui.enabled=false + +isProduction=false +grievanceAllocationRetryConfiguration=3 + +start-grievancedatasync-scheduler=false +cron-scheduler-grievancedatasync=0 0/2 * * * ?