-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
166 lines (157 loc) · 4.98 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
version: "3"
services: # An example. You can modify such as defining more than one node for each type below.
nginx: # webserver
image: nginx:1.17
container_name: paddict_nginx
ports:
- "8000:8000"
volumes:
- ./:/src
- ./config/nginx:/etc/nginx/conf.d
- ./static:/static
depends_on:
- student
networks:
- net
db: # MySQL
image: mariadb:5.5 #mysql:5.7
container_name: paddict_db
command: mysqld --character-set-server=utf8 --collation-server=utf8_unicode_ci
environment:
- MYSQL_HOST=localhost
- MYSQL_PORT=3306 # cannot change this port to other number
- MYSQL_ROOT_HOST=%
- MYSQL_DATABASE=paddict
- MYSQL_ROOT_PASSWORD=paddict
ports:
- "33061:3306"
expose:
- 3306
volumes:
- ./db/mysql:/var/lib/mysql
networks:
- net
neo4j: # Graph data indexing
image: marxen68/neo4j-algo:3.5.6
container_name: paddict_neo4j
ports:
- 7474:7474
- 7687:7687
volumes:
- ./db/neo4j:/data/dbms
#- ./db/neo4j/plugins:/var/lib/neo4j/plugins
environment:
NEO4J_AUTH: 'neo4j/paddict'
NEO4J_dbms_security_procedures_unrestricted: "algo.*"
NEO4J_dbms_security_procedures_whitelist: "algo.*"
networks:
- net
redis: # key-value DB for async tasks
image: redis:5.0.5
container_name: paddict_redis
networks:
- net
es01:
image: blacktop/elasticsearch:2.4
container_name: es01
environment:
- node.name=es01
- discovery.seed_hosts=es02
- cluster.initial_master_nodes=es01,es02
- cluster.name=docker-cluster
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- esdata01:/usr/share/elasticsearch/data
ports:
- 9200:9200
networks:
- net
es02:
image: blacktop/elasticsearch:2.4
container_name: es02
environment:
- node.name=es02
- discovery.seed_hosts=es01
- cluster.initial_master_nodes=es01,es02
- cluster.name=docker-cluster
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- esdata02:/usr/share/elasticsearch/data
networks:
- net
student: # The student webapp, which will execute the tasks of crawling (collecting) data and indexing data WITH the help of other nodes such as celery (for task queues), es01/es02 (for text indexing), db (for MySQL), nginx (for web server), and UNDER the manual tasks of supervisor node.
image: marxen68/paddict:latest
depends_on:
- db
- neo4j
- redis
- es01
- es02
volumes:
- ./:/src
- ./static:/static
container_name: paddict_main
expose:
- "8000"
command:
- bash
- -c
- |
/etc/init.d/mysql start
python manage.py collectstatic --noinput
python manage.py makemigrations
python manage.py migrate
#python manage.py update_index --batch-size 1 --workers 4 --verbosity 2
python manage.py install_labels
gunicorn papers.wsgi -b 0.0.0.0:8000
networks:
- net
celery: # This node is to run celery to connect to redis
image: marxen68/paddict:latest
depends_on:
- student
volumes:
- ./:/src
- ./static:/static
container_name: celery
command:
- bash
- -c
- |
celery -A papers worker --loglevel=info
networks:
- net
supervisor: # we need this node to do some others stuffs such as CERMINE/OCR/download, .etc. A human user will login to here to perform some supervised tasks manually. Logs are recorded by docker.
image: marxen68/paddict:latest
depends_on:
- student
volumes:
- ./:/src
- ./static:/static
container_name: paddict_supervisor
stdin_open: true # must have this to prevent stopping after up
tty: true # must have this
networks:
- net
#command:
#- /etc/init.d/mysql start
#- apt install -y openjdk-8-jdk
#- java -version
volumes:
esdata01:
driver: local
esdata02:
driver: local
networks:
net:
driver: bridge