forked from binux/pyspider
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
105 lines (101 loc) · 2.46 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
version: "3.7"
# replace /path/to/dir/ to point to config.json
# The RabbitMQ and CouchDB services can take some time to startup.
# During this time most of the pyspider services will exit and restart.
# Once RabbitMQ and CouchDB are fully up and running everything should run as normal.
services:
rabbitmq:
image: rabbitmq:alpine
container_name: rabbitmq
networks:
- pyspider
command: rabbitmq-server
mysql:
image: mysql:latest
container_name: mysql
volumes:
- /tmp:/var/lib/mysql
environment:
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
networks:
- pyspider
phantomjs:
image: pyspider:latest
container_name: phantomjs
networks:
- pyspider
volumes:
- ./config_example.json:/opt/pyspider/config.json
command: -c config.json phantomjs
depends_on:
- couchdb
- rabbitmq
restart: unless-stopped
result:
image: pyspider:latest
container_name: result
networks:
- pyspider
volumes:
- ./config_example.json:/opt/pyspider/config.json
command: -c config.json result_worker
depends_on:
- couchdb
- rabbitmq
restart: unless-stopped # Sometimes we'll get a connection refused error because couchdb has yet to fully start
processor:
container_name: processor
image: pyspider:latest
networks:
- pyspider
volumes:
- ./config_example.json:/opt/pyspider/config.json
command: -c config.json processor
depends_on:
- couchdb
- rabbitmq
restart: unless-stopped
fetcher:
image: pyspider:latest
container_name: fetcher
networks:
- pyspider
volumes:
- ./config_example.json:/opt/pyspider/config.json
command : -c config.json fetcher
depends_on:
- couchdb
- rabbitmq
restart: unless-stopped
scheduler:
image: pyspider:latest
container_name: scheduler
networks:
- pyspider
volumes:
- ./config_example.json:/opt/pyspider/config.json
command: -c config.json scheduler
depends_on:
- couchdb
- rabbitmq
restart: unless-stopped
webui:
image: pyspider:latest
container_name: webui
ports:
- "5050:5000"
networks:
- pyspider
volumes:
- ./config_example.json:/opt/pyspider/config.json
command: -c config.json webui
depends_on:
- couchdb
- rabbitmq
restart: unless-stopped
networks:
pyspider:
external:
name: pyspider
default:
driver: bridge