Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
147 lines (123 loc) · 3.58 KB
/
Copy pathdocker-compose.yml
File metadata and controls
147 lines (123 loc) · 3.58 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
services:
app:
build:
context: .
dockerfile: Dockerfile
image: notification-system:local
ports:
- "${APP_PORT:-8080}:8080"
environment:
APP_NAME: ${APP_NAME:-notification-system}
VIRTUAL_THREADS_ENABLED: ${VIRTUAL_THREADS_ENABLED:-false}
SPRING_DATASOURCE_URL: jdbc:mysql://mysql:3306/notification
SPRING_DATASOURCE_USERNAME: notification
SPRING_DATASOURCE_PASSWORD: notification
SPRING_RABBITMQ_HOST: rabbitmq
SPRING_RABBITMQ_PORT: 5672
SPRING_RABBITMQ_USERNAME: notification
SPRING_RABBITMQ_PASSWORD: notification
NOTIFICATION_CONSUMER_CONCURRENCY: ${NOTIFICATION_CONSUMER_CONCURRENCY:-5}
RABBITMQ_PREFETCH: ${RABBITMQ_PREFETCH:-50}
MOCK_PROVIDER_FORCE_FAILURE: ${MOCK_PROVIDER_FORCE_FAILURE:-false}
MOCK_PROVIDER_FAIL_FIRST_ATTEMPTS: ${MOCK_PROVIDER_FAIL_FIRST_ATTEMPTS:-0}
OUTBOX_PUBLISH_INTERVAL_MS: ${OUTBOX_PUBLISH_INTERVAL_MS:-1000}
SPRING_DATA_REDIS_HOST: redis
SPRING_DATA_REDIS_PORT: 6379
healthcheck:
test:
- CMD
- curl
- -fsS
- http://localhost:8080/actuator/health/liveness
interval: 10s
timeout: 3s
retries: 5
start_period: 20s
depends_on:
mysql:
condition: service_healthy
rabbitmq:
condition: service_healthy
prometheus:
image: prom/prometheus:v3.13.0
ports:
- "${PROMETHEUS_PORT:-9090}:9090"
volumes:
- ./monitoring/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus-data:/prometheus
command:
- --config.file=/etc/prometheus/prometheus.yml
- --storage.tsdb.path=/prometheus
- --web.enable-lifecycle
depends_on:
app:
condition: service_healthy
grafana:
image: grafana/grafana:13.1.1-ubuntu
ports:
- "${GRAFANA_PORT:-3000}:3000"
environment:
GF_SECURITY_ADMIN_USER: ${GRAFANA_ADMIN_USER:-admin}
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_ADMIN_PASSWORD:-admin}
GF_USERS_ALLOW_SIGN_UP: "false"
volumes:
- grafana-data:/var/lib/grafana
- ./monitoring/grafana/provisioning/datasources:/etc/grafana/provisioning/datasources:ro
- ./monitoring/grafana/provisioning/dashboards:/etc/grafana/provisioning/dashboards:ro
- ./monitoring/grafana/dashboards:/var/lib/grafana/dashboards:ro
depends_on:
- prometheus
k6:
image: grafana/k6:2.1.0
profiles:
- test
environment:
BASE_URL: http://app:8080
volumes:
- ./k6:/scripts:ro
depends_on:
app:
condition: service_healthy
mysql:
image: mysql:8.4
environment:
MYSQL_DATABASE: notification
MYSQL_USER: notification
MYSQL_PASSWORD: notification
MYSQL_ROOT_PASSWORD: root
ports:
- "3306:3306"
volumes:
- mysql-data:/var/lib/mysql
healthcheck:
test: [ "CMD", "mysqladmin", "ping", "-h", "localhost", "-uroot", "-proot" ]
interval: 5s
timeout: 3s
retries: 10
rabbitmq:
image: rabbitmq:4-management
container_name: notification-rabbitmq
ports:
- "5672:5672"
- "15672:15672"
environment:
RABBITMQ_DEFAULT_USER: notification
RABBITMQ_DEFAULT_PASS: notification
healthcheck:
test: [ "CMD", "rabbitmq-diagnostics", "-q", "ping" ]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7.4
ports:
- "6379:6379"
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 5s
timeout: 3s
retries: 10
volumes:
prometheus-data:
grafana-data:
mysql-data: