File tree Expand file tree Collapse file tree 10 files changed +149
-8
lines changed
Expand file tree Collapse file tree 10 files changed +149
-8
lines changed Original file line number Diff line number Diff line change 1+ target /
2+ .mvn /wrapper /maven-wrapper.jar
3+ ! ** /src /main /** /target /
4+ ! ** /src /test /** /target /
5+
6+ # ## STS ###
7+ .apt_generated
8+ .classpath
9+ .factorypath
10+ .project
11+ .settings
12+ .springBeans
13+ .sts4-cache
14+
15+ # ## IntelliJ IDEA ###
16+ .idea
17+ * .iws
18+ * .iml
19+ * .ipr
20+
21+ # ## NetBeans ###
22+ /nbproject /private /
23+ /nbbuild /
24+ /dist /
25+ /nbdist /
26+ /.nb-gradle /
27+ build /
28+ ! ** /src /main /** /build /
29+ ! ** /src /test /** /build /
30+
31+ # ## VS Code ###
32+ .vscode /
Original file line number Diff line number Diff line change @@ -8,16 +8,17 @@ services:
88 ports :
99 - " 8080:8080"
1010 environment :
11- SPRING_DATASOURCE_URL : jdbc:mysql://mysql-container:3306/myapp_db?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC
11+ SPRING_PROFILES_ACTIVE : prd
12+ SPRING_DATASOURCE_URL : jdbc:mysql://mysql-db:3306/myapp_db?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC
1213 SPRING_DATASOURCE_USERNAME : myapp_user
1314 SPRING_DATASOURCE_PASSWORD : user123
1415 SPRING_DATASOURCE_DRIVER : com.mysql.cj.jdbc.Driver
1516 SPRING_JPA_HIBERNATE_DDL_AUTO : none
1617 SPRING_JPA_SHOW_SQL : false
1718
18- mysql :
19+ mysql-db :
1920 image : mysql:8.1
20- container_name : mysql-container
21+ container_name : mysql-db
2122 ports :
2223 - " 3306:3306"
2324 environment :
Original file line number Diff line number Diff line change 1+ target /
2+ .mvn /wrapper /maven-wrapper.jar
3+ ! ** /src /main /** /target /
4+ ! ** /src /test /** /target /
5+
6+ # ## STS ###
7+ .apt_generated
8+ .classpath
9+ .factorypath
10+ .project
11+ .settings
12+ .springBeans
13+ .sts4-cache
14+
15+ # ## IntelliJ IDEA ###
16+ .idea
17+ * .iws
18+ * .iml
19+ * .ipr
20+
21+ # ## NetBeans ###
22+ /nbproject /private /
23+ /nbbuild /
24+ /dist /
25+ /nbdist /
26+ /.nb-gradle /
27+ build /
28+ ! ** /src /main /** /build /
29+ ! ** /src /test /** /build /
30+
31+ # ## VS Code ###
32+ .vscode /
Original file line number Diff line number Diff line change @@ -34,7 +34,9 @@ USER appuser
3434COPY --from=package build/target/app.jar app.jar
3535
3636COPY docker/java/entrypoint.sh /entrypoint.sh
37+ USER root
3738RUN chmod +x /entrypoint.sh
39+ USER appuser
3840
3941EXPOSE 8082
4042
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ services:
77 ports :
88 - " 8082:8082"
99 environment :
10- SPRING_PROFILES_ACTIVE : default
10+ SPRING_PROFILES_ACTIVE : prd
1111 SERVER_PORT : 8082
1212 SPRING_DATASOURCE_URL : jdbc:oracle:thin:@oracle-db:1521
1313 SPRING_DATASOURCE_USERNAME : developer
Original file line number Diff line number Diff line change @@ -5,4 +5,4 @@ echo "Waiting 30 seconds..."
55sleep 30
66
77echo " Starting the application..."
8- exec java org.springframework.boot.loader.launch.JarLauncher
8+ exec java -jar app.jar
Original file line number Diff line number Diff line change 1+ target /
2+ .mvn /wrapper /maven-wrapper.jar
3+ ! ** /src /main /** /target /
4+ ! ** /src /test /** /target /
5+
6+ # ## STS ###
7+ .apt_generated
8+ .classpath
9+ .factorypath
10+ .project
11+ .settings
12+ .springBeans
13+ .sts4-cache
14+
15+ # ## IntelliJ IDEA ###
16+ .idea
17+ * .iws
18+ * .iml
19+ * .ipr
20+
21+ # ## NetBeans ###
22+ /nbproject /private /
23+ /nbbuild /
24+ /dist /
25+ /nbdist /
26+ /.nb-gradle /
27+ build /
28+ ! ** /src /main /** /build /
29+ ! ** /src /test /** /build /
30+
31+ # ## VS Code ###
32+ .vscode /
Original file line number Diff line number Diff line change @@ -35,4 +35,4 @@ COPY --from=package build/target/app.jar app.jar
3535
3636EXPOSE 8081
3737
38- ENTRYPOINT [ "java" , "-jar" , "app.jar" ]
38+ ENTRYPOINT [ "java" , "-jar" , "app.jar" ]
Original file line number Diff line number Diff line change @@ -6,10 +6,18 @@ services:
66 context : .
77 ports :
88 - " 8081:8081"
9+ environment :
10+ SPRING_PROFILES_ACTIVE : prd
11+ SPRING_DATASOURCE_URL : jdbc:postgresql://postgres-db:5432/myapp_db
12+ SPRING_DATASOURCE_USERNAME : myapp_user
13+ SPRING_DATASOURCE_PASSWORD : user123
14+ SPRING_DATASOURCE_DRIVER : org.postgresql.Driver
15+ SPRING_JPA_HIBERNATE_DDL_AUTO : none
16+ SPRING_JPA_SHOW_SQL : false
917
10- postgres :
18+ postgres-db :
1119 image : postgres:17
12- container_name : postgres-container
20+ container_name : postgres-db
1321 ports :
1422 - " 5432:5432"
1523 environment :
Original file line number Diff line number Diff line change 6262
6363 </dependencies >
6464
65+ <build >
66+ <plugins >
67+
68+ <plugin >
69+ <groupId >org.apache.maven.plugins</groupId >
70+ <artifactId >maven-compiler-plugin</artifactId >
71+ <version >${maven.compiler.plugin.version} </version >
72+ <configuration >
73+ <annotationProcessorPaths >
74+ <path >
75+ <groupId >org.projectlombok</groupId >
76+ <artifactId >lombok</artifactId >
77+ </path >
78+ </annotationProcessorPaths >
79+ </configuration >
80+ </plugin >
81+
82+ <plugin >
83+ <groupId >org.springframework.boot</groupId >
84+ <artifactId >spring-boot-maven-plugin</artifactId >
85+ <version >${spring.boot.version} </version >
86+ <configuration >
87+ <excludes >
88+ <exclude >
89+ <groupId >org.projectlombok</groupId >
90+ <artifactId >lombok</artifactId >
91+ </exclude >
92+ </excludes >
93+ </configuration >
94+ </plugin >
95+
96+ </plugins >
97+
98+ </build >
6599
66100</project >
67101
You can’t perform that action at this time.
0 commit comments