forked from hpi-epic/pricewars
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
172 lines (159 loc) · 3.89 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
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
version: '3.1'
services:
postgres:
image: postgres:9.6.5
environment:
- POSTGRES_USER=pricewars
- POSTGRES_PASSWORD=1337
- POSTGRES_DB=marketplace
redis:
image: redis:latest
ports:
- "6379:6379"
zookeeper:
image: zookeeper:3.4
ports:
- "2181:2181"
kafka:
image: wurstmeister/kafka:latest
ports:
- "9092:9092"
environment:
- KAFKA_ADVERTISED_HOST_NAME=kafka
- KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181
- KAFKA_DELETE_TOPIC_ENABLE=true
- KAFKA_LOG_DIRS=/kafka/kafka-logs
- KAFKA_LOG_RETENTION_HOURS=-1
- LOG4J_LOGGER_KAFKA=WARN
- LOG4J_LOGGER_ORG_APACHE_ZOOKEEPER=WARN
depends_on:
- zookeeper
kafka-reverse-proxy:
build: ./kafka-reverse-proxy
ports:
- "8001:8001"
command: ["python3", "-u", "LoggerApp.py", "--kafka_url", "kafka:9092"]
depends_on:
- kafka
links:
- kafka
flink-jobmanager:
image: melentye/flink:latest
ports:
- "8081:8081"
expose:
- "6123"
environment:
- KAFKA_URL=kafka:9092
command: "bash '/analytics/start-jobmanager.sh'"
volumes:
- ./analytics:/analytics:ro
depends_on:
- analytics
- kafka
links:
- kafka
flink-taskmanager:
image: melentye/flink:latest
expose:
- "6121"
- "6122"
environment:
- TASK_MANAGER_RPC_PORT=6122
- TASK_MANAGER_DATA_PORT=6121
command: "bash '/analytics/start-taskmanager.sh'"
volumes:
- ./analytics:/analytics:ro
depends_on:
- analytics
- flink-jobmanager
links:
- flink-jobmanager
analytics:
build: ./analytics
# Flink jobs are compiled when this image is created.
# On container start, the Flink jobs are copied to the host filesystem where they
# can be found by the flink container.
# Newer files in the destination are not overwritten by the copy command.
# This way, the jobs can be updated on the host and used in the docker setup without rebuilding the image.
command: "bash -c 'mkdir -p /export/target/jars/ && cp -u /analytics/target/jars/* /export/target/jars/ && chmod -R 777 /export/target'"
volumes:
- ./analytics:/export
management-ui:
build: ./mgmt-ui
ports:
- "80:80"
depends_on:
- kafka-reverse-proxy
- marketplace
- producer
marketplace:
build: ./marketplace
ports:
- "8080:8080"
environment:
- POSTGRES_USER=pricewars
- POSTGRES_PASSWORD=1337
- POSTGRES_HOST=postgres
- POSTGRES_PORT=5432
- POSTGRES_DB=marketplace
- KAFKA_URL=kafka:9092
- REDIS_HOST=redis
- PRICEWARS_PRODUCER_URL=http://producer:3050
volumes:
- ./marketplace/src:/marketplace/src
depends_on:
- postgres
- redis
- kafka
- producer
links:
- postgres
- redis
- kafka
- producer
producer:
build: ./producer
ports:
- "3050:3050"
environment:
- KAFKA_URL=kafka:9092
depends_on:
- kafka
volumes:
- ./producer/controllers:/producer/controllers
consumer:
build: ./consumer
ports:
- "3000:3000"
environment:
- RAILS_ENV=development
- PRICEWARS_MARKETPLACE_URL=marketplace:8080
- PRICEWARS_PRODUCER_URL=producer:3050
# volumes:
# - ./pricewars-consumer:/consumer
command: "bash -c 'rm -rf /consumer/tmp/pids/server.pid; bundle exec rails s -b 0.0.0.0'"
depends_on:
- marketplace
links:
- marketplace
merchant:
build: ./merchant
ports:
- "5003:5003"
command: python3 -u merchant.py --port 5000 --strategy "Two Bound"
volumes:
- ./merchant:/merchant
depends_on:
- producer
- marketplace
links:
- producer
- marketplace
networks:
default:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.29.0.0/24