-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
160 lines (152 loc) · 5.1 KB
/
Copy pathdocker-compose.yml
File metadata and controls
160 lines (152 loc) · 5.1 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
services:
postgres:
container_name: dev_fast_healthchecks_postgres
image: postgres:17-alpine
platform: ${DOCKER_PLATFORM:-linux/amd64}
ports: ['${POSTGRES_PORT}:5432']
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DATABASE}
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB']
interval: 2s
timeout: 5s
retries: 15
start_period: 5s
redis:
container_name: dev_fast_healthchecks_redis
image: redis:8-alpine
platform: ${DOCKER_PLATFORM:-linux/amd64}
restart: on-failure
ports: ['6379:6379']
command: ["redis-server", "--requirepass", "${REDIS_PASSWORD}"]
environment:
REDIS_PASSWORD: ${REDIS_PASSWORD}
healthcheck:
test: ['CMD-SHELL', 'redis-cli -a "$$REDIS_PASSWORD" ping | grep -q PONG']
interval: 2s
timeout: 5s
retries: 15
start_period: 3s
rabbitmq:
container_name: dev_fast_healthchecks_rabbitmq
image: rabbitmq:4-alpine
platform: ${DOCKER_PLATFORM:-linux/amd64}
restart: always
ports:
- '${RABBITMQ_PORT}:5672'
environment:
RABBITMQ_DEFAULT_USER: ${RABBITMQ_USER}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_PASSWORD}
RABBITMQ_DEFAULT_VHOST: ${RABBITMQ_VHOST}
healthcheck:
test: ['CMD', 'rabbitmq-diagnostics', '-q', 'ping']
interval: 5s
timeout: 10s
retries: 10
start_period: 15s
zookeeper:
container_name: dev_fast_healthchecks_zookeeper
image: confluentinc/cp-zookeeper:7.9.2
platform: ${DOCKER_PLATFORM:-linux/amd64}
hostname: zookeeper
ports:
- "2181:2181"
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
healthcheck:
# Confluent image only enables "srvr" four-letter word, not "ruok"
test: ['CMD-SHELL', 'echo srvr | nc -w 2 localhost 2181 | grep -q Mode']
interval: 5s
timeout: 5s
retries: 10
start_period: 10s
kafka1:
container_name: dev_fast_healthchecks_kafka1
image: confluentinc/cp-kafka:7.9.2
platform: ${DOCKER_PLATFORM:-linux/amd64}
hostname: kafka1
depends_on:
zookeeper:
condition: service_healthy
ports:
- "9094:9094"
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka1:9092,OUTSIDE://localhost:9094
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,OUTSIDE:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
healthcheck:
test: ['CMD-SHELL', 'kafka-broker-api-versions --bootstrap-server localhost:9092 || exit 1']
interval: 5s
timeout: 10s
retries: 15
start_period: 20s
kafka2:
container_name: dev_fast_healthchecks_kafka2
image: confluentinc/cp-kafka:7.9.2
platform: ${DOCKER_PLATFORM:-linux/amd64}
hostname: kafka2
depends_on:
zookeeper:
condition: service_healthy
ports:
- "9095:9095"
environment:
KAFKA_BROKER_ID: 2
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka2:9093,OUTSIDE://localhost:9095
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,OUTSIDE:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
healthcheck:
test: ['CMD-SHELL', 'kafka-broker-api-versions --bootstrap-server localhost:9093 || exit 1']
interval: 5s
timeout: 10s
retries: 15
start_period: 20s
mongo:
container_name: dev_fast_healthchecks_mongo
image: mongo:8
platform: ${DOCKER_PLATFORM:-linux/amd64}
restart: always
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_USER}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_PASSWORD}
MONGO_INITDB_DATABASE: ${MONGO_DATABASE}
ports:
- "${MONGO_PORT}:27017"
healthcheck:
test: ['CMD', 'mongosh', '--eval', "db.adminCommand('ping')"]
interval: 5s
timeout: 10s
retries: 10
start_period: 15s
opensearch:
container_name: dev_fast_healthchecks_opensearch
image: opensearchproject/opensearch
platform: ${DOCKER_PLATFORM:-linux/amd64}
environment:
- discovery.type=single-node # Single node discovery
- bootstrap.memory_lock=true # Disable JVM heap memory swapping
- "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m" # Set min and max JVM heap sizes to at least 50% of system RAM
- "DISABLE_INSTALL_DEMO_CONFIG=true" # Prevents execution of bundled demo script which installs demo certificates and security configurations to OpenSearch
- "DISABLE_SECURITY_PLUGIN=true" # Disables Security plugin
ulimits:
memlock:
soft: -1 # Set memlock to unlimited (no soft or hard limit)
hard: -1
nofile:
soft: 65536 # Maximum number of open files for the opensearch user - set to at least 65536
hard: 65536
ports:
- 9200:9200 # REST API
- 9600:9600 # Performance Analyzer
healthcheck:
test: ['CMD-SHELL', 'curl -sf http://localhost:9200/_cluster/health || exit 1']
interval: 10s
timeout: 10s
retries: 15
start_period: 40s