-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
143 lines (131 loc) · 3.03 KB
/
docker-compose.yml
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
version: "3"
services:
web: &basePy
build:
context: .
dockerfile: ./dockerfiles/py/Dockerfile
volumes:
- ./main:/main
- static_files:/static_files
- uploaded_files:/uploaded_files
env_file:
- ./dockerfiles/py/.app_env
depends_on:
- postgres
links:
- postgres
command: sh /appRun.sh
restart: unless-stopped
faust:
<<: *basePy
depends_on:
- web
- redis
- kafka
- kafka-create-topics
links:
- redis
- kafka
- kafka-create-topics
ports:
- "6066:6066"
command: sh /faustRun.sh
restart: unless-stopped
locust_master:
image: locustio/locust
ports:
- "8089:8089"
expose:
- "8089"
volumes:
- ./main/tests:/mnt/locust
depends_on:
- nginx
command: -f /mnt/locust/test_locust.py --master -H http://nginx:8000
locust_worker:
image: locustio/locust
volumes:
- ./main/tests:/mnt/locust
depends_on:
- nginx
- locust_master
command: -f /mnt/locust/test_locust.py --worker --master-host locust_master
postgres:
image: postgres
build: ./dockerfiles/postgresql/
volumes:
- pgdata:/var/lib/postgresql/data/
env_file:
- ./dockerfiles/postgresql/.pg_env
ports:
- "5432:5432"
expose:
- "5432"
restart: unless-stopped
redis:
image: redis:5.0.5
ports:
- "6385:6379"
expose:
- "6385"
command: ["redis-server", "--protected-mode", "no"]
hostname: redis
restart: unless-stopped
nginx:
build:
context: .
dockerfile: ./dockerfiles/nginx/Dockerfile
ports:
- "8000:8000"
expose:
- "8000"
volumes:
- static_files:/static_files
- uploaded_files:/uploaded_files
depends_on:
- web
restart: unless-stopped
zookeeper:
image: confluentinc/cp-zookeeper:5.2.0
hostname: zookeeper
ports:
- "2181:2181"
expose:
- "2181"
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
restart: on-failure
kafka:
image: confluentinc/cp-kafka:5.2.0
hostname: kafka
ports:
- "9092:9092"
expose:
- "9092"
depends_on:
- zookeeper
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false"
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
restart: on-failure
kafka-create-topics:
image: confluentinc/cp-kafka:5.2.0
depends_on:
- kafka
hostname: kafka-create-topics
command: "bash -c 'echo Waiting for Kafka to be ready... && \
cub kafka-ready -b kafka:9092 1 20 && \
kafka-topics --create --topic test --if-not-exists --zookeeper zookeeper:2181 --partitions 1 --replication-factor 1 && \
sleep infinity'"
environment:
KAFKA_BROKER_ID: ignored
KAFKA_ZOOKEEPER_CONNECT: ignored
restart: on-failure
volumes:
pgdata:
static_files:
uploaded_files: