-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathdocker-compose-trefick.yml
184 lines (165 loc) · 4.97 KB
/
docker-compose-trefick.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
173
174
175
176
177
178
179
180
181
182
183
184
version: "3"
# The docker-compose.yml file defines 8 services of DockerFinder
# The services are divided in three groups:
# 1) analysis: crawler, scanner, rabbitmq
# 2) discovery: webapp, software-server, sotware_db
# 3) storage:: images_server, images_db
services:
traefik:
image: traefik
command: --web --docker --docker.domain=localhost --logLevel=DEBUG
ports:
- "80:80"
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- $PWD/traefik.toml:/etc/traefik/traefik.toml
# - /dev/null:/traefik.toml
############### ANALYSIS PHASE ####################
crawler:
image: diunipisocc/docker-finder:crawler
build:
context: analysis
dockerfile: ./Dockerfile_crawler
command: [crawl,'--save-url=/data/crawler/lasturl.txt',
'--amqp-url=amqp://guest:guest@rabbitmq:5672',
'--images-url=http://images_server:3000/api/images/',
'--queue=images',
'--force-page=False', # force to generate the url with the "fp" without take the last url
#'--si=10000',
'--random=True',
'--fp=1',
'--ps=10',
'--policy=stars_first',
'--min-stars=3',
'--min-pulls=0',
#'--only-official',
'--only-automated',
]
#,'--si=100'] #, '--fp=100', '--ps=10']
volumes:
- crawler_volume:/data/crawler/
deploy:
placement:
constraints:
- node.hostname==swarm-manager
rabbitmq:
image: rabbitmq:3-management
hostname: rabbitmq
restart: on-failure:3
# ports:
# - 8082:15672
volumes:
- rabbitmq_volume:/var/lib/rabbitmq
deploy:
placement:
constraints:
- node.hostname==swarm-manager
labels:
- 'traefik.port=8082'
- 'traefik.frontend.rule=PathStrip: /rabbitmq'
scanner:
image: diunipisocc/docker-finder:scanner
build:
context: analysis
dockerfile: ./Dockerfile_scanner
command: [run, '--images-url=http://images_server:3000/api/images/',
'--queue=images',
'--key=images.scan',
'--software-url=http://software_server:3001/api/software', '--rmi']
volumes:
- /var/run/docker.sock:/var/run/docker.sock
deploy:
mode: replicated
replicas: 10
placement:
constraints:
- node.hostname != swarm-manager
restart_policy:
condition: on-failure
#
# #####################################################
# ############### DISCOVERY PHASE ####################
# #####################################################
#
software_server:
build: discovery/softwareService/software_server
image: diunipisocc/docker-finder:software_server
hostname: software_server
ports:
- "3001:3001"
depends_on:
- software_db
deploy:
placement:
constraints:
- node.hostname==swarm-manager
software_db:
image: mongo:3
hostname: software_db
volumes:
- software_db_volume:/data/db # /data/db is the deafult directory where mogno stores the databases.
deploy:
placement:
constraints:
- node.hostname == swarm-manager
webapp:
build: discovery/webapp/
image: diunipisocc/docker-finder:webapp
restart: on-failure:3
# ports:
# - 80:80
volumes:
- ./discovery/webapp:/code
deploy:
placement:
constraints:
- node.hostname == swarm-manager
# #####################################################
# ############### STORAGE PHASE ####################
# #####################################################
images_server:
build: storage/images_server
image: diunipisocc/docker-finder:images_server
hostname: images_server
restart: on-failure:3
# ports:
# - "3000:3000"
depends_on:
- images_db
deploy:
placement:
constraints:
- node.hostname == swarm-manager
# labels:
# - "traefik.backend=docker"
# - "traefik.frontend.rule=Host:images.localhost"
# - "traefik.enable=true"
# - "traefik.port=3000"
images_db:
image: mongo:3
restart: on-failure:3
hostname: images_db
volumes:
- images_db_volume:/data/db
deploy:
placement:
constraints:
- node.hostname == swarm-manager
volumes:
crawler_volume:
rabbitmq_volume:
images_db_volume:
software_db_volume:
#####################################################
############### MANAGEMENT PHASE ####################
#####################################################
##
# monitor:
# #container_name: monitor
# build: management
# ports:
# - "3002:3002"
# volumes:
# df-software:
# external: true