generated from it-at-m/oss-repository-en-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
179 lines (167 loc) · 5.75 KB
/
docker-compose.yml
File metadata and controls
179 lines (167 loc) · 5.75 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
name: swim-stack
services:
#
# ============= DB =============
#
postgres:
image: postgres:17.4-alpine3.20@sha256:67c27fd3b866e5e3da543b37c70654a13d45d5c4bcb3a2cd9b2813a5c9e167dd
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=admin
- POSTGRES_PASSWORD=admin
- POSTGRES_HOST_AUTH_METHOD=scram-sha-256
- POSTGRES_INITDB_ARGS=--auth-host=scram-sha-256 --auth-local=scram-sha-256
ports:
- "5432:5432"
healthcheck: &healthcheck
test: ["CMD-SHELL", "pg_isready -d postgres -U admin"]
start_period: 15s
interval: 5s
timeout: 10s
retries: 10
security_opt: &security_settings
- no-new-privileges:true
# see https://event-driven.io/en/automatically_connect_pgadmin_to_database/
pg-admin:
image: dpage/pgadmin4:8.14@sha256:8a68677a97b8c8d1427dc915672a26d2c4a04376916a68256f53d669d6171be7
environment:
- PGADMIN_DEFAULT_EMAIL=admin@admin.com
- PGADMIN_DEFAULT_PASSWORD=admin
- PGADMIN_CONFIG_SERVER_MODE=False
- PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED=False
- PGADMIN_LISTEN_PORT=5050
ports:
- "5050:5050"
depends_on:
- postgres
healthcheck:
<<: *healthcheck
test: ["CMD", "wget", "-O", "-", "http://localhost:5050/misc/ping"]
security_opt: *security_settings
volumes:
- './pgadmin/servers.json:/pgadmin4/servers.json:ro'
- './pgadmin/pgpass:/pgadmin4/pgpass'
user: root # see https://github.com/pgadmin-org/pgadmin4/issues/6257
entrypoint: /bin/sh -c "chmod 600 /pgadmin4/pgpass; /entrypoint.sh;" # see https://www.postgresql.org/docs/current/libpq-pgpass.html#LIBPQ-PGPASS (last paragraph)
#
# ============= Kafka =============
#
zookeeper:
image: confluentinc/cp-zookeeper:7.8.6@sha256:b93c9edcdf05de005063ba26f72eda4611d40c530828bb8847c8f848189d9adc
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
ports:
- '22181:2181'
networks:
- internal
healthcheck:
<<: *healthcheck
test: nc -z localhost 2181 || exit -1
security_opt:
- no-new-privileges:true
kafka:
image: confluentinc/cp-kafka:7.8.6@sha256:778f64413532f180148569116b3f5d734e7f1c0cdee650b984f88fd97a20a4f9
depends_on:
zookeeper:
condition: service_healthy
ports:
- '9092:9092'
- '29092:29092'
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092,PLAINTEXT_HOST://localhost:29092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
networks:
- internal
healthcheck:
<<: *healthcheck
test: nc -z localhost 9092 || exit -1
security_opt: *security_settings
kafka-ui:
image: provectuslabs/kafka-ui@sha256:8f2ff02d64b0a7a2b71b6b3b3148b85f66d00ec20ad40c30bdcd415d46d31818
ports:
- '8089:8080'
depends_on:
- kafka
- zookeeper
environment:
KAFKA_CLUSTERS_0_NAME: local
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka:9092
KAFKA_CLUSTERS_0_ZOOKEEPER: zookeeper:2181
DYNAMIC_CONFIG_ENABLED: 'true'
networks:
- internal
healthcheck:
<<: *healthcheck
test: [ "CMD-SHELL", "wget --spider --timeout=1 http://localhost:8080/actuator/health" ]
security_opt: *security_settings
init-kafka:
image: confluentinc/cp-kafka:latest@sha256:d20bd62f01826c454e88530efc6d73654cb4697182f37206742b96c7b947236e
depends_on:
kafka:
condition: service_healthy
entrypoint: [ '/bin/bash', '-c' ]
networks:
- internal
command: |
"
# blocks until kafka is reachable
echo -e 'Currently available topics:'
kafka-topics --bootstrap-server kafka:9092 --list
echo -e 'Creating kafka topics...'
kafka-topics --bootstrap-server kafka:9092 --create --if-not-exists --topic swim-finished-local --replication-factor 1 --partitions 1
kafka-topics --bootstrap-server kafka:9092 --create --if-not-exists --topic swim-dispatch-dlq-local --replication-factor 1 --partitions 1
kafka-topics --bootstrap-server kafka:9092 --create --if-not-exists --topic swim-dms-local --replication-factor 1 --partitions 1
kafka-topics --bootstrap-server kafka:9092 --create --if-not-exists --topic swim-invoice-local --replication-factor 1 --partitions 1
echo -e 'Resulting topics:'
kafka-topics --bootstrap-server kafka:9092 --list
"
security_opt: *security_settings
#
# ============= S3 =============
#
minio:
image: quay.io/minio/minio:latest@sha256:14cea493d9a34af32f524e538b8346cf79f3321eff8e708c1e2960462bd8936e
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: minio
MINIO_ROOT_PASSWORD: Test1234
ports:
- '9000:9000'
- '9001:9001'
volumes:
- ./minio:/data
networks:
- internal
healthcheck:
<<: *healthcheck
test: [ "CMD-SHELL", "curl http://localhost:9000/minio/health/live" ]
security_opt: *security_settings
init-minio:
image: minio/mc@sha256:a7fe349ef4bd8521fb8497f55c6042871b2ae640607cf99d9bede5e9bdf11727
depends_on:
- minio
entrypoint: >
/bin/sh -c "
mc config host add minio http://minio:9000 minio Test1234;
mc mb minio/swim-bucket;
exit 0;
"
networks:
- internal
security_opt: *security_settings
#
# ============= Mail =============
#
mailpit:
image: axllent/mailpit:v1.20.7@sha256:7eef0f38dbc85e4e264f2edf5d70fbb694826791e05cb2cae4fc9e3282f968f5
ports:
- '1025:1025' # SMTP Server
- '8025:8025' # UI
security_opt: *security_settings
networks:
internal: