diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..f99697fa --- /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=docker -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 5a083ba5..70859837 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 @@ -425,6 +425,18 @@ + + org.springframework.boot + spring-boot-maven-plugin + 3.2.2 + + + + repackage + + + + diff --git a/src/main/environment/common_ci.properties b/src/main/environment/common_ci.properties index 714e33d8..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@ @@ -84,4 +84,4 @@ logging.path=logs 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..b9faf6ad --- /dev/null +++ b/src/main/environment/common_docker.properties @@ -0,0 +1,87 @@ +# 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}carestream/createOrder + +## Identity - Common URLs +# Registration +registrationUrl =${COMMON_API}beneficiary/createBeneficiary + +registrarQuickSearchByIdUrl =${COMMON_API}beneficiary/searchUserByID + +registrarQuickSearchByPhoneNoUrl =${COMMON_API}beneficiary/searchUserByPhone + +getBenImageFromIdentity =${IDENTITY_API_BASE_URL}id/benImageByBenRegID + +beneficiaryEditUrl =${COMMON_API}beneficiary/updateBenefciaryDetails + +registrarAdvanceSearchUrl =${COMMON_API}beneficiary/searchBeneficiary + +## Data Sync API, central +dataSyncUploadUrl=${MMU_CENTRAL_SERVER}dataSync/van-to-server + +## Data download API, central +dataSyncDownloadUrl=${MMU_CENTRAL_SERVER}dataSync/server-to-van + +## TC specialist slot booking, # not required +tcSpecialistSlotBook=${TM_API}schedule/bookSlot + +## TC specialist slot cancelling, # not required +tcSpecialistSlotCancel=${TM_API}schedule/cancelBookedSlot + +## benGenUrl, common, central +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 + +tmCentralServer = ${TM_CENTRAL_SERVER}common/get/Case-sheet/printData + +specialistSign=${COMMON_API}signature1/getSignClass + +## inventory transaction download URL, central, mmu +dataSyncTransactionDownloadUrl=${MMU_CENTRAL_SERVER}dataSync/server-to-van-transactional + +## inventory transaction processed flag update URL, central, mmu +dataSyncProcessedFlagUpdate=${MMU_CENTRAL_SERVER}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}fileSyncController/getServerCredential +tmReferCheckValue=TM +### Redis IP +spring.redis.host=${REDIS_HOST} + +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} \ No newline at end of file