forked from Richie78321/play-rl-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
120 lines (119 loc) · 3.36 KB
/
docker-compose.yaml
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
version: '3'
services:
zookeeper:
image: bitnami/zookeeper:latest
restart: always
volumes:
- zookeeper_data:/bitnami/zookeeper
environment:
- ALLOW_ANONYMOUS_LOGIN=yes
kafka1:
image: bitnami/kafka:latest
restart: always
ports:
- "29092:29092"
environment:
- KAFKA_CFG_BROKER_ID=1
- KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181
- KAFKA_CFG_LISTENERS=PLAINTEXT://:9092,PLAINTEXT_HOST://:29092
- KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://kafka1:9092,PLAINTEXT_HOST://localhost:29092
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
- KAFKA_CFG_INTER_BROKER_LISTENER_NAME=PLAINTEXT
- ALLOW_PLAINTEXT_LISTENER=yes
volumes:
- "kafka1_data:/bitnami/kafka"
# This ensures that Kafka can properly unregister itself from ZooKeeper before ZooKeeper stops.
depends_on:
- zookeeper
kafka2:
image: bitnami/kafka:latest
restart: always
ports:
- "39092:39092"
environment:
- KAFKA_CFG_BROKER_ID=2
- KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181
- KAFKA_CFG_LISTENERS=PLAINTEXT://:9092,PLAINTEXT_HOST://:39092
- KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://kafka2:9092,PLAINTEXT_HOST://localhost:39092
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
- KAFKA_CFG_INTER_BROKER_LISTENER_NAME=PLAINTEXT
- ALLOW_PLAINTEXT_LISTENER=yes
volumes:
- "kafka2_data:/bitnami/kafka"
# This ensures that Kafka can properly unregister itself from ZooKeeper before ZooKeeper stops.
depends_on:
- zookeeper
postgres:
image: postgres:latest
ports:
- "5432:5432"
restart: always
environment:
- POSTGRES_USER=user
- POSTGRES_PASSWORD=password
- POSTGRES_DB=playdata
volumes:
- postgres_data:/var/lib/postgresql/data
- ./postgres.sql:/docker-entrypoint-initdb.d/postgres.sql:ro
pgadmin:
image: dpage/pgadmin4:latest
restart: always
ports:
- "8081:80"
environment:
- PGADMIN_DEFAULT_PASSWORD=password
volumes:
- pgadmin_data:/var/lib/pgadmin
logstash:
build:
dockerfile: ./Logstash.Dockerfile
restart: always
volumes:
- ./logstash.conf:/usr/share/logstash/pipeline/logstash.conf:ro
environment:
- XPACK_MONITORING_ENABLED=false
depends_on:
- kafka1
- kafka2
agent-api:
build:
context: ./api
dockerfile: ./agent-api.Dockerfile
restart: always
environment:
- AGENT_DATA_PATH=/agent_data/agent_data.pickle
- POSTGRES_CONNECTION=postgresql://user:password@postgres:5432/playdata
- PYTHONUNBUFFERED=TRUE
volumes:
- ./agent_data/:/agent_data/
playdata-api:
build:
context: ./api
dockerfile: ./playdata-api.Dockerfile
restart: always
environment:
- KAFKA_BOOTSTRAP_SERVER=kafka1:9092
depends_on:
- kafka1
- kafka2
volumes:
# Needed for testing with Monte-Carlo
- ./agent_data/:/agent_data/:ro
frontend:
build:
context: ./frontend
restart: always
proxy:
image: nginx:latest
restart: always
ports:
- "8080:80"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
volumes:
kafka1_data:
kafka2_data:
zookeeper_data:
postgres_data:
pgadmin_data: