-
Notifications
You must be signed in to change notification settings - Fork 1
/
crawler_worker.yml
75 lines (72 loc) · 2.35 KB
/
crawler_worker.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
version: '3.8'
services:
crawler_twse:
# Set the image
image: linsamtw/class01_crawler:dev
# Set the hostname, used for display in Flower
hostname: "{{.Node.Hostname}}-{{.Service.Name}}"
# Command to start the worker
command: pipenv run celery -A fin_engine.worker worker --loglevel=info --concurrency=1 --hostname=%h.twse -Q twse
deploy:
replicas: 1
update_config:
parallelism: 1
delay: 10s
placement:
# Limit to one instance per node to avoid IP bans from the exchange
max_replicas_per_node: 1
# Only deploy on nodes with the label crawler_twse=true
constraints: [node.labels.crawler_twse == true]
restart: always
environment:
- TZ=Asia/Taipei
networks:
- my_network
crawler_tpex:
# Set the image
image: linsamtw/class01_crawler:dev
# Set the hostname, used for display in Flower
hostname: "{{.Node.Hostname}}-{{.Service.Name}}"
# Command to start the worker
command: pipenv run celery -A fin_engine.worker worker --loglevel=info --concurrency=1 --hostname=%h.tpex -Q tpex
deploy:
replicas: 1
update_config:
parallelism: 1
delay: 10s
placement:
# Limit to one instance per node to avoid IP bans from the exchange
max_replicas_per_node: 1
# Only deploy on nodes with the label crawler_tpex=true
constraints: [node.labels.crawler_tpex == true]
restart: always
environment:
- TZ=Asia/Taipei
networks:
- my_network
crawler_taifex:
# Set the image
image: linsamtw/class01_crawler:dev
# Set the hostname, used for display in Flower
hostname: "{{.Node.Hostname}}-{{.Service.Name}}"
# Command to start the worker
command: pipenv run celery -A fin_engine.worker worker --loglevel=info --concurrency=1 --hostname=%h.taifex -Q taifex
deploy:
replicas: 1
update_config:
parallelism: 1
delay: 10s
placement:
# Limit to one instance per node to avoid IP bans from the exchange
max_replicas_per_node: 1
# Only deploy on nodes with the label crawler_taifex=true
constraints: [node.labels.crawler_taifex == true]
restart: always
environment:
- TZ=Asia/Taipei
networks:
- my_network
networks:
my_network:
# Join an existing network
external: true