diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index d23d1d6..5ac5ec7 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -1,4 +1,9 @@ eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore +org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault +org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable +org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.methodParameters=generate org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 @@ -7,7 +12,13 @@ org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error +org.eclipse.jdt.core.compiler.problem.nullReference=warning +org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error +org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning +org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled org.eclipse.jdt.core.compiler.processAnnotations=enabled org.eclipse.jdt.core.compiler.release=enabled org.eclipse.jdt.core.compiler.source=17 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f99697f --- /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 b327141..8027e14 100644 --- a/pom.xml +++ b/pom.xml @@ -400,7 +400,18 @@ - + + org.springframework.boot + spring-boot-maven-plugin + 3.2.2 + + + + repackage + + + + diff --git a/src/main/environment/104_ci.properties b/src/main/environment/104_ci.properties index 2443c86..657944e 100644 --- a/src/main/environment/104_ci.properties +++ b/src/main/environment/104_ci.properties @@ -15,7 +15,7 @@ secondary.datasource.driver-class-name=com.mysql.cj.jdbc.Driver common-url=@env.COMMON_API_BASE_URL@ ### Redis IP -spring.redis.host=localhost +spring.redis.host=@env.REDIS_HOST@ #ELK logging file name logging.path=logs/ diff --git a/src/main/environment/104_docker.properties b/src/main/environment/104_docker.properties new file mode 100644 index 0000000..c6a56c4 --- /dev/null +++ b/src/main/environment/104_docker.properties @@ -0,0 +1,28 @@ +# local env +# DB Connections +## Primary db +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 + +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.cj.jdbc.Driver + +# Common Config +common-url=${COMMON_API_BASE_URL} + +### Redis IP +spring.redis.host=${REDIS_HOST} + +#ELK logging file name +logging.file.name=${HELPLINE104_API_LOGGING_FILE_NAME} +jwt.secret=${JWT_SECRET_KEY} +springdoc.api-docs.enabled=${SWAGGER_DOC_ENABLED} +springdoc.swagger-ui.enabled=${SWAGGER_DOC_ENABLED} + + +sendSMSUrl= ${COMMON_API_BASE_URL}sms/sendSMS +sendEmailGeneralUrl = ${COMMON_API_BASE_URL}emailController/sendEmailGeneral \ No newline at end of file