-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
131 lines (122 loc) · 2.79 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
version: '3'
services:
server:
image: pdb_project/rest_api
container_name: rest_api
restart: always
build:
context: ./
dockerfile: Dockerfile
ports:
- "5000:5000"
env_file:
- .env
links:
- mysql
- mongodb
- kafka
depends_on:
- mysql
- mongodb
- kafka
mysql:
image: mysql
container_name: mysql-db
volumes:
# pass volume named mysql-data to mysql container
- mysql-data:/var/lib/mysql
restart: unless-stopped
environment:
MYSQL_DATABASE: pdb
MYSQL_USER: pdb
MYSQL_PASSWORD: pdb
MYSQL_ROOT_PASSWORD: pdb
phpmyadmin:
depends_on:
- mysql
image: phpmyadmin/phpmyadmin:latest
container_name: mysql-phpmyadmin
ports:
- "5010:80"
environment:
PMA_HOST: mysql
MYSQL_ROOT_PASSWORD: pdb
MYSQL_USER: pdb
MYSQL_PASSWORD: pdb
links:
- mysql
mongodb:
image: mongo
container_name: mongo-db
restart: unless-stopped
volumes:
- mongo-data:/var/lib/mongo
environment:
MONGO_INITDB_ROOT_USERNAME: pdb
MONGO_INITDB_ROOT_PASSWORD: pdb
MONGO_INITDB_DATABASE: pdb
MONGODB_DATA_DIR: /var/lib/mongo
MONDODB_LOG_DIR: /dev/null
mongo-express:
image: mongo-express
container_name: mongo-express
depends_on:
- mongodb
restart: always
ports:
- 5020:8081
environment:
ME_CONFIG_MONGODB_ADMINUSERNAME: pdb
ME_CONFIG_MONGODB_ADMINPASSWORD: pdb
ME_CONFIG_MONGODB_SERVER: mongodb
ME_CONFIG_MONGODB_ENABLE_ADMIN: true
links:
- mongodb
zookeeper:
image: confluentinc/cp-zookeeper:latest
container_name: zookeeper
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
ports:
- "2181:2181"
tmpfs: "/datalog"
kafka:
image: confluentinc/cp-kafka:latest
container_name: kafka
restart: always
depends_on:
- zookeeper
ports:
- "9092:9092"
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
volumes:
- /var/run/docker.sock:/var/run/docker.sock
consumer:
build:
context: .
dockerfile: ./app/apache_kafka/Dockerfile
container_name: consumer
restart: always
depends_on:
- kafka
- server
- mongodb
- mysql
- zookeeper
links:
- mysql
- mongodb
- kafka
volumes:
# persistance data
mysql-data:
driver: local
mongo-data:
driver: local