-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
114 lines (107 loc) · 2.83 KB
/
docker-compose.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
version: '3.8'
services:
rabbitmq:
image: rabbitmq:3-management
container_name: rabbitmq
volumes:
- ./rabbit_cfg/rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf:ro
- ./rabbit_cfg/definitions.json:/etc/rabbitmq/definitions.json:ro
ports:
- "5672:5672"
- "15672:15672"
environment:
RABBITMQ_DEFAULT_USER: admin
RABBITMQ_DEFAULT_PASS: vesper
healthcheck:
test: ["CMD", "rabbitmq-diagnostics", "-q", "ping"]
interval: 5s
timeout: 10s
retries: 5
networks:
- micro-network
student-app:
build:
context: ./studentRegistrationService
dockerfile: Dockerfile
container_name: student-app
ports:
- "8080:8080"
environment:
- SPRING_RABBITMQ_HOST=rabbitmq
- SPRING_RABBITMQ_USERNAME=admin
- SPRING_RABBITMQ_PASSWORD=vesper
- SPRING_DATASOURCE_URL=jdbc:postgresql://postgres:5432/student
- SPRING_DATASOURCE_USERNAME=postgres
- SPRING_DATASOURCE_PASSWORD=vesper
- SPRING_JPA_HIBERNATE_DDL_AUTO=update
- SPRING_KAFKA_BOOTSTRAP_SERVERS=kafka:9092
- SPRING_KAFKA_TOPIC=student-topic
depends_on:
rabbitmq:
condition: service_healthy
postgres:
condition: service_started
kafka:
condition: service_started
networks:
- micro-network
email-service:
build:
context: ./emailService
dockerfile: Dockerfile
container_name: email-service
depends_on:
rabbitmq:
condition: service_healthy
student-app:
condition: service_started
kafka:
condition: service_started
environment:
- SPRING_RABBITMQ_HOST=rabbitmq
- SPRING_RABBITMQ_USERNAME=admin
- SPRING_RABBITMQ_PASSWORD=vesper
- SPRING_MAIL_PASSWORD=mcog dxej dixf yojc
- SPRING_MAIL_HOST=smtp.gmail.com
- SPRING_MAIL_PORT=587
- SPRING_KAFKA_BOOTSTRAP_SERVERS=kafka:9092
- SPRING_KAFKA_TOPIC=student-topic
networks:
- micro-network
postgres:
image: postgres:latest
container_name: postgres
ports:
- "5432:5432"
environment:
POSTGRES_DB: student
POSTGRES_USER: postgres
POSTGRES_PASSWORD: vesper
networks:
- micro-network
zookeeper:
image: wurstmeister/zookeeper:3.4.6
container_name: zookeeper
ports:
- "2181:2181"
networks:
- micro-network
kafka:
image: wurstmeister/kafka:latest
container_name: kafka
ports:
- "9092:9092"
environment:
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_CREATE_TOPICS: "student-topic:1:1"
depends_on:
- zookeeper
- student-app
- email-service
networks:
- micro-network
networks:
micro-network:
driver: bridge