File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # --- Stage 1: Build the application using Maven ---
2+ FROM maven:3.9.6-eclipse-temurin-17 AS build
3+
4+ WORKDIR /app
5+
6+ COPY . .
7+
8+ # Build the application while caching Maven dependencies to speed up future builds
9+ RUN --mount=type=cache,target=/root/.m2 \
10+ mvn clean package -DENV_VAR=docker -DskipTests -Dgit.skip=true
11+
12+ # --- Stage 2: Run the application with a minimal JRE image ---
13+ FROM eclipse-temurin:17-jre
14+
15+ WORKDIR /app
16+
17+ # Copy the built WAR file from the build stage
18+ COPY --from=build /app/target/*.war app.war
19+
20+ EXPOSE 8080
21+
22+ ENTRYPOINT ["java" , "-jar" , "app.war" ]
Original file line number Diff line number Diff line change 392392 </execution >
393393 </executions >
394394 </plugin >
395+ <plugin >
396+ <groupId >org.springframework.boot</groupId >
397+ <artifactId >spring-boot-maven-plugin</artifactId >
398+ <version >3.2.2</version >
399+ <executions >
400+ <execution >
401+ <goals >
402+ <goal >repackage</goal >
403+ </goals >
404+ </execution >
405+ </executions >
406+ </plugin >
395407 </plugins >
396408 </build >
397409 <reporting >
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ callcentre-server-ip=@env.CALLCENTRE_SERVER_IP@
1515common-url =@env.COMMON_API@
1616
1717# ## Redis IP
18- spring.redis.host =localhost
18+ spring.redis.host =@env.REDIS_HOST@
1919jwt.secret =@env.JWT_SECRET_KEY@
2020
2121# ELK logging file name
@@ -25,4 +25,3 @@ logging.file.name=@env.SCHEDULER_API_LOGGING_FILE_NAME@
2525springdoc.api-docs.enabled =@env.SWAGGER_DOC_ENABLED@
2626springdoc.swagger-ui.enabled =@env.SWAGGER_DOC_ENABLED@
2727
28-
Original file line number Diff line number Diff line change 1+ # local env
2+ # DB Connections
3+ spring.datasource.url =${DATABASE_URL}
4+ spring.datasource.username =${DATABASE_USERNAME}
5+ spring.datasource.password =${DATABASE_PASSWORD}
6+ spring.datasource.driver-class-name =com.mysql.cj.jdbc.Driver
7+
8+ spring.jpa.show-sql =true
9+
10+ spring.profiles.active =test
11+
12+ callcentre-server-ip =${CALLCENTRE_SERVER_IP}
13+
14+ common-url =${COMMON_API}
15+
16+ # ## Redis IP
17+ spring.redis.host =${REDIS_HOST}
18+ jwt.secret =${JWT_SECRET_KEY}
19+
20+ # ELK logging file name
21+ logging.file.name =${SCHEDULER_API_LOGGING_FILE_NAME}
22+
23+ springdoc.api-docs.enabled =${SWAGGER_DOC_ENABLED}
24+ springdoc.swagger-ui.enabled =${SWAGGER_DOC_ENABLED}
You can’t perform that action at this time.
0 commit comments