-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
121 lines (112 loc) · 2.9 KB
/
docker-compose.yml
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
115
116
117
118
119
120
121
version: "3.8"
services:
# Environment Setup Service
env-setup:
image: alpine:latest
command: ["sh", "-c", "cp /app/.env.example /app/.env"]
volumes:
- .:/app
entrypoint: ["sh", "-c", "cp /app/.env.example /app/.env"]
# PostgreSQL service
postgres-db:
image: postgres:alpine
container_name: db
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- "5432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -d postgres -U postgres"]
interval: 10s
timeout: 5s
retries: 5
# Zookeeper service
zookeeper:
image: wurstmeister/zookeeper:latest
ports:
- "2181:2181"
depends_on:
- env-setup
# Kafka service
kafka:
image: wurstmeister/kafka:latest
ports:
- "9092:9092"
- "9093:9092"
environment:
KAFKA_ADVERTISED_LISTENERS: INSIDE://kafka:9093,OUTSIDE://localhost:9092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT
KAFKA_LISTENERS: INSIDE://0.0.0.0:9093,OUTSIDE://0.0.0.0:9092
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_INTER_BROKER_LISTENER_NAME: INSIDE
KAFKA_LOG4J_LOGGERS: "kafka=DEBUG, kafka.request.logger=DEBUG"
depends_on:
- zookeeper
- env-setup
healthcheck:
test:
["CMD", "kafka-topics.sh", "--bootstrap-server", "kafka:9092", "--list"]
interval: 5s
timeout: 5s
retries: 5
# API service
api:
build:
context: ./api
ports:
- "3000:3000"
depends_on:
postgres-db:
condition: service_healthy
kafka:
condition: service_healthy
environment:
DATABASE_URL: "postgresql://postgres:postgres@postgres-db:5432/postgres"
EMAIL: "${EMAIL}"
MOBILE: "${MOBILE}"
PORT: 3000
KAFKA_BROKER: "kafka:9093"
# WhatsApp Consumer Service
whatsapp-consumer:
build:
context: ./whatsapp-consumer
depends_on:
kafka:
condition: service_healthy
environment:
KAFKA_BROKER: "kafka:9093"
TWILIO_ACCOUNT_SID: "asdasd"
TWILIO_AUTH_TOKEN: "asdasdas"
TWILIO_SMS_FROM: "+141xxxx8886"
# SMS Consumer Service
sms-consumer:
build:
context: ./sms-consumer
depends_on:
kafka:
condition: service_healthy
environment:
KAFKA_BROKER: "kafka:9093"
TWILIO_ACCOUNT_SID: "asdasd"
TWILIO_AUTH_TOKEN: "asdasdas"
TWILIO_SMS_FROM: "+141xxxx8886"
# Email Consumer Service
email-consumer:
build:
context: ./email-consumer
depends_on:
kafka:
condition: service_healthy
environment:
KAFKA_BROKER: "kafka:9093"
SIB_KEY: jasndasndans3123213iuhasbcbiuh2hu
SENDER_NAME: Rishi Singh
SENDER_EMAIL: [email protected]
volumes:
postgres-data:
external: false