Skip to content

Commit 4542a1b

Browse files
committed
create docker image for apigw & eureka-server
1 parent b78aaea commit 4542a1b

File tree

7 files changed

+121
-0
lines changed

7 files changed

+121
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
server:
2+
port: 8083
3+
4+
spring:
5+
application:
6+
name: api-gateway
7+
8+
zipkin:
9+
base-url: http://zipkin:9411
10+
11+
cloud:
12+
gateway:
13+
routes:
14+
- id: customer
15+
uri: lb://CUSTOMER
16+
predicates:
17+
- Path=/api/v1/customer/**
18+
19+
eureka:
20+
client:
21+
service-url:
22+
defaultZone: http://eureka-server:8761/eureka
23+
fetch-registry: true
24+
register-with-eureka: true

customer/pom.xml

+14
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,20 @@
2525
</plugins>
2626
</build>
2727

28+
<profiles>
29+
<profile>
30+
<id>build-docker-image</id>
31+
<build>
32+
<plugins>
33+
<plugin>
34+
<groupId>com.google.cloud.tools</groupId>
35+
<artifactId>jib-maven-plugin</artifactId>
36+
</plugin>
37+
</plugins>
38+
</build>
39+
</profile>
40+
</profiles>
41+
2842
<dependencies>
2943
<dependency>
3044
<groupId>org.springframework.boot</groupId>

docker-compose.yml

+27
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,43 @@ services:
3232
container_name: zipkin
3333
ports:
3434
- "9411:9411"
35+
networks:
36+
- spring
3537
rabbitmq:
3638
image: rabbitmq:3.9.11-management-alpine
3739
container_name: rabbitmq
3840
ports:
3941
- "5672:5672"
4042
- "15672:15672"
43+
eureka-server:
44+
image: hrkarimi/eureka-server:latest
45+
container_name: eureka-server
46+
ports:
47+
- "8761:8761"
48+
environment:
49+
- SPRING_PROFILES_ACTIVE=docker
50+
networks:
51+
- spring
52+
depends_on:
53+
- zipkin
54+
apigw:
55+
image: hrkarimi/apigw:latest
56+
container_name: apigw
57+
ports:
58+
- "8083:8083"
59+
environment:
60+
- SPRING_PROFILES_ACTIVE=docker
61+
networks:
62+
- spring
63+
depends_on:
64+
- zipkin
65+
- eureka-server
4166

4267
networks:
4368
postgres:
4469
driver: bridge
70+
spring:
71+
driver: bridge
4572

4673
volumes:
4774
postgres:

eureka-server/pom.xml

+14
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,20 @@
2525
</plugins>
2626
</build>
2727

28+
<profiles>
29+
<profile>
30+
<id>build-docker-image</id>
31+
<build>
32+
<plugins>
33+
<plugin>
34+
<groupId>com.google.cloud.tools</groupId>
35+
<artifactId>jib-maven-plugin</artifactId>
36+
</plugin>
37+
</plugins>
38+
</build>
39+
</profile>
40+
</profiles>
41+
2842
<dependencies>
2943
<dependency>
3044
<groupId>org.springframework.cloud</groupId>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
spring:
2+
application:
3+
name: eureka-server
4+
5+
zipkin:
6+
base-url: http://zipkin:9411
7+
8+
server:
9+
port: 8761
10+
11+
eureka:
12+
client:
13+
fetch-registry: false
14+
register-with-eureka: false

fraud/pom.xml

+14
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,20 @@
2525
</plugins>
2626
</build>
2727

28+
<profiles>
29+
<profile>
30+
<id>build-docker-image</id>
31+
<build>
32+
<plugins>
33+
<plugin>
34+
<groupId>com.google.cloud.tools</groupId>
35+
<artifactId>jib-maven-plugin</artifactId>
36+
</plugin>
37+
</plugins>
38+
</build>
39+
</profile>
40+
</profiles>
41+
2842
<dependencies>
2943
<dependency>
3044
<groupId>org.springframework.boot</groupId>

notification/pom.xml

+14
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,20 @@
2525
</plugins>
2626
</build>
2727

28+
<profiles>
29+
<profile>
30+
<id>build-docker-image</id>
31+
<build>
32+
<plugins>
33+
<plugin>
34+
<groupId>com.google.cloud.tools</groupId>
35+
<artifactId>jib-maven-plugin</artifactId>
36+
</plugin>
37+
</plugins>
38+
</build>
39+
</profile>
40+
</profiles>
41+
2842
<dependencies>
2943
<dependency>
3044
<groupId>org.springframework.boot</groupId>

0 commit comments

Comments
 (0)