-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
201 lines (190 loc) · 4.82 KB
/
docker-compose.yml
File metadata and controls
201 lines (190 loc) · 4.82 KB
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
services:
nginx:
image: nginx:alpine
container_name: notification-nginx
ports:
- "8888:80"
volumes:
- ./docker/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- api-gateway
networks:
- notification-network
# PostgreSQL Database
postgres:
image: postgres:15-alpine
container_name: notification-postgres
environment:
POSTGRES_USER: notif_user
POSTGRES_PASSWORD: notif_pass_2024
POSTGRES_DB: notification_system
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- notification-network
# Redis Cache
redis:
image: redis:7-alpine
container_name: notification-redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
networks:
- notification-network
# RabbitMQ Message Queue
rabbitmq:
image: rabbitmq:3.12-management-alpine
container_name: notification-rabbitmq
environment:
RABBITMQ_DEFAULT_USER: rabbitmq_user
RABBITMQ_DEFAULT_PASS: rabbitmq_pass_2024
ports:
- "5672:5672" # AMQP port
- "15672:15672" # Management UI
volumes:
- rabbitmq_data:/var/lib/rabbitmq
networks:
- notification-network
# Prometheus Monitoring
prometheus:
image: prom/prometheus:latest
container_name: notification-prometheus
ports:
- "9090:9090"
volumes:
- ./docker/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
- '--web.enable-lifecycle'
networks:
- notification-network
extra_hosts:
- "host.docker.internal:host-gateway"
# Grafana Dashboards
grafana:
image: grafana/grafana:latest
container_name: notification-grafana
ports:
- "3100:3000"
volumes:
- grafana_data:/var/lib/grafana
- ./docker/grafana/provisioning:/etc/grafana/provisioning
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin123
- GF_USERS_ALLOW_SIGN_UP=false
networks:
- notification-network
depends_on:
- prometheus
# API Gateway
api-gateway:
build:
context: .
dockerfile: Dockerfile
target: api-gateway
container_name: api-gateway
# ports removed: internal Docker networking only
env_file:
- apps/api-gateway/.env
environment:
- POSTGRES_HOST=postgres
- POSTGRES_DB=notification_system
- REDIS_HOST=redis
- RABBITMQ_URL=amqp://rabbitmq_user:rabbitmq_pass_2024@rabbitmq:5672
depends_on:
- postgres
- redis
- rabbitmq
networks:
- notification-network
restart: unless-stopped
# User Service
user-service:
build:
context: .
dockerfile: Dockerfile
target: user-service
container_name: user-service
# ports removed: internal Docker networking only
env_file:
- apps/user-service/.env
environment:
- PORT=3001
- DB_HOST=postgres
- DB_NAME=notification_system
- REDIS_HOST=redis
depends_on:
- postgres
- redis
networks:
- notification-network
restart: unless-stopped
# Email Service
email-service:
build:
context: .
dockerfile: Dockerfile
target: email-service
container_name: email-service
# ports removed: internal Docker networking only
env_file:
- apps/email-service/.env
environment:
- RABBITMQ_URL=amqp://rabbitmq_user:rabbitmq_pass_2024@rabbitmq:5672
depends_on:
- rabbitmq
networks:
- notification-network
restart: unless-stopped
# Push Service
push-service:
build:
context: .
dockerfile: Dockerfile
target: push-service
container_name: push-service
# ports removed: internal Docker networking only
env_file:
- apps/push-service/.env
environment:
- RABBITMQ_URL=amqp://rabbitmq_user:rabbitmq_pass_2024@rabbitmq:5672
depends_on:
- rabbitmq
networks:
- notification-network
restart: unless-stopped
# Template Service
template-service:
build:
context: .
dockerfile: Dockerfile
target: template-service
container_name: template-service
# ports removed: internal Docker networking only
env_file:
- apps/template-service/.env
environment:
- DB_HOST=postgres
- DB_NAME=notification_system
- REDIS_HOST=redis
depends_on:
- postgres
- redis
networks:
- notification-network
restart: unless-stopped
volumes:
postgres_data:
redis_data:
rabbitmq_data:
prometheus_data:
grafana_data:
networks:
notification-network:
driver: bridge