-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
159 lines (136 loc) · 4.23 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
# Even though latest ATM is 3,
# sticking wtih 2.1 for the "condition" in "depends_on"
# It was deprecated in version 3
# Check https://docs.docker.com/compose/startup-order/
version: '2.1'
services:
# fscrawler service for indexing a folder
# Also check `fscrawlerrest` service for REST access
fscrawler:
build:
# ubuntu as base image
context: ${PWD}
# alpine linux as base image
# context: ${PWD}/alpine
volumes:
- ${PWD}/test/data/:/usr/share/fscrawler/data/:ro
#- ~/Documents/:/usr/share/fscrawler/data/:ro
- ${PWD}/config/docker-compose:/usr/share/fscrawler/config-mount/docker-compose
# Despite the python tester having a built-in healthcheck at tests/es_acceptance.py#wait_for_cluster_health
# Using the dockerfile healthcheck extends this to other services without having to re-code a wait for health status in each
# Note that this requires docker-compose.yml version 2.1, docker-compose>=1.11, docker>=1.13
depends_on:
# Should be es_init here, but not sure why fscrawler fails to detect it has executed
# This "depends_on.condition" syntax is deprecated anyway, so not thinking it through
# es_init:
elasticsearch1:
condition: service_healthy
networks:
- fscrawler-networks
command:
- --trace
- --config_dir
- /usr/share/fscrawler/config
- docker-compose
api: # Node.js App
build:
context: ${PWD}/build/server_api
ports:
- "3000:3000" # Expose API port
- "9229:9229" # Expose Node process debug port (disable in production)
environment: # Set ENV vars
- NODE_ENV=local
- ES_HOST=elasticsearch1
- PORT=3000
networks:
- fscrawler-networks
frontend: # Nginx Server For Frontend App
image: nginx
volumes: # Serve local "public" dir
- ./build/public:/usr/share/nginx/html
ports:
- "8686:80" # Forward site to localhost:8686
networks:
- fscrawler-networks
elasticsearch1:
environment:
- xpack.security.enabled=false
- xpack.monitoring.enabled=false
- xpack.ml.enabled=false
- xpack.graph.enabled=false
- xpack.watcher.enabled=false
ports: # Expose ElasticSearch ports
- "9300:9300"
- "9200:9200"
build:
# build a dockerfile on top of the official elasticsearch docker image hosted at docker.elastic.co
# It includes healthcheck
# Check build/elasticsearch/Dockerfile for more details
context: ${PWD}/build/elasticsearch
networks:
- fscrawler-networks
kibana1:
build:
context: ${PWD}/build/kibana
volumes:
- ./build/kibana/kibana.yml:/usr/share/kibana/config/kibana.yml
environment:
- ES_URL=http://elasticsearch1:9200
#- "ELASTICSEARCH_URL=http://elasticsearch:9200"
ports: # Expose ElasticSearch ports
- "5601:5601"
links:
- elasticsearch1
depends_on:
elasticsearch1:
condition: service_healthy
networks:
- fscrawler-networks
# service that serves .travis.yml to make curl calls to elasticsearch1 and fscrawler
tester:
build:
context: ${PWD}/build/tester/
volumes:
- ${PWD}/test/data/:/usr/share/fscrawler/data/:ro
networks:
- fscrawler-networks
# worker service that uploads example pipeline
es_init:
build:
context: ${PWD}/build/es_init/
depends_on:
elasticsearch1:
condition: service_healthy
environment:
- ES_URL=http://elasticsearch1:9200
networks:
- fscrawler-networks
# cannot name service with underscores
# https://github.com/dadoonet/fscrawler/issues/474
fscrawlerrest:
build:
context: ${PWD}
# alpine
# context: ${PWD}/alpine
volumes:
- ${PWD}/test/data/:/usr/share/fscrawler/data/:ro
- ${PWD}/config/fscrawler_rest:/usr/share/fscrawler/config-mount/fscrawler_rest
# check note above in fscrawler.depends_on
depends_on:
elasticsearch1:
condition: service_healthy
ports:
- "8890:8080"
networks:
- fscrawler-networks
command:
- --trace
- --config_dir
- /usr/share/fscrawler/config
- --loop
- "0"
- --rest
- fscrawler_rest
networks:
fscrawler-networks:
driver: bridge