-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
71 lines (66 loc) · 1.74 KB
/
Copy pathdocker-compose.yml
File metadata and controls
71 lines (66 loc) · 1.74 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
services:
api:
build: ./middleware
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
env_file: ./.env
environment:
- POSTGRES_HOST=postgres
- REDIS_HOST=redis
ports:
- $API_PORT:8000
healthcheck:
test: ["CMD-SHELL", "curl", "localhost:8000/"]
interval: 1s
timeout: 3s
retries: 30
postgres:
image: postgres:14.1-alpine
env_file: ./.env
environment:
- PGUSER=$POSTGRES_USER
ports:
- $POSTGRES_PORT:5432
volumes:
- ./db:/docker-entrypoint-initdb.d
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 1s
timeout: 3s
retries: 30
redis:
image: redis:6.2-alpine
restart: always
env_file: ./.env
ports:
- $REDIS_PORT:6379
command: redis-server --save 20 1 --loglevel warning --requirepass $REDIS_PASSWORD
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 1s
timeout: 3s
retries: 30
zookeeper:
image: bitnami/zookeeper:latest
ports:
- "$ZK_PORT:2181"
environment:
- ALLOW_ANONYMOUS_LOGIN=yes
kafka:
image: bitnami/kafka:latest
depends_on:
- zookeeper
ports:
- "$KAFKA_PORT:9092"
- "$KAFKA_LISTENER_PORT:9093"
environment:
- ALLOW_PLAINTEXT_LISTENER=yes
- KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CLIENT:PLAINTEXT,EXTERNAL:PLAINTEXT
- KAFKA_CFG_LISTENERS=CLIENT://:9092,EXTERNAL://:$KAFKA_LISTENER_PORT
- KAFKA_CFG_ADVERTISED_LISTENERS=CLIENT://kafka:9092,EXTERNAL://$KAFKA_HOST:$KAFKA_LISTENER_PORT
- KAFKA_CFG_INTER_BROKER_LISTENER_NAME=CLIENT
restart: unless-stopped