-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
182 lines (172 loc) · 4.61 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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
services:
django:
image: laxy:latest
working_dir: /app
environment:
- LAXY_DATABASE_URL=postgres://postgres:postgres@db:5432/postgres
- LAXY_BROKER_URL=amqp://guest@rabbitmq
- LAXY_WEB_SCRAPER_BACKEND=splash
- LAXY_WEB_SCRAPER_SPLASH_HOST=http://splash:8050
command: bash -c "sleep 10 && python3 manage.py runserver 0.0.0.0:8001"
expose:
- "8001"
depends_on:
- db
- queue-high
- queue-low
dev-frontend-server:
image: laxy:latest
restart: "no"
command: echo "Service disabled unless explicitly overridden (eg in
docker-compose.local-dev.yml)"
db:
image: postgres:10-alpine
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres
- PGDATA=/var/lib/postgresql/data/pgdata
volumes:
- dbdata:/var/lib/postgresql/data/pgdata
# - type: volume
# source: dbdata
# target: /var/lib/postgresql/data/pgdata
# volume:
# nocopy: true
# expose:
# - "5432"
rabbitmq:
# version >3.8.14 requires consumer_timeout setting increase in rabbitmq config
# more info: https://github.com/apache/airflow/issues/15799
image: rabbitmq:3.8.14-management-alpine
hostname: "rabbitmq"
volumes:
- rabbitmq_data:/var/lib/rabbitmq
# expose:
# - "5672"
# - "15672"
queue-high:
image: laxy:latest
working_dir: /app
environment:
- LAXY_DATABASE_URL=postgres://postgres:postgres@db:5432/postgres
- LAXY_BROKER_URL=amqp://guest@rabbitmq
# - LAXY_BROKER_URL=redis://redis:6379/0
- LAXY_WEB_SCRAPER_BACKEND=splash
- LAXY_WEB_SCRAPER_SPLASH_HOST=http://splash:8050
command:
[
"celery",
"-A",
"laxy",
"worker",
"-E",
"-l",
"info",
"-Ofair",
"--broker=${LAXY_BROKER_URL}"
]
stop_grace_period: 5m
stop_signal: SIGTERM
depends_on:
- db
- rabbitmq
queue-low:
image: laxy:latest
working_dir: /app
environment:
- LAXY_DATABASE_URL=postgres://postgres:postgres@db:5432/postgres
- LAXY_BROKER_URL=amqp://guest@rabbitmq
# - LAXY_BROKER_URL=redis://redis:6379/0
- LAXY_WEB_SCRAPER_BACKEND=splash
- LAXY_WEB_SCRAPER_SPLASH_HOST=http://splash:8050
command:
[
"celery",
"-A",
"laxy",
"worker",
"-E",
"-l",
"info",
"-Ofair",
"--broker=${LAXY_BROKER_URL}",
"-Q",
"low-priority"
]
stop_grace_period: 5m
stop_signal: SIGTERM
depends_on:
- db
- rabbitmq
celery-beat:
image: laxy:latest
working_dir: /app
environment:
- LAXY_DATABASE_URL=postgres://postgres:postgres@db:5432/postgres
- LAXY_BROKER_URL=amqp://guest@rabbitmq
# - LAXY_BROKER_URL=redis://redis:6379/0
- LAXY_WEB_SCRAPER_BACKEND=splash
- LAXY_WEB_SCRAPER_SPLASH_HOST=http://splash:8050
command:
[
"celery",
"-A",
"laxy",
"--broker=${LAXY_BROKER_URL}",
"-s",
"/app/celerybeat-schedule",
"beat"
]
depends_on:
- db
- rabbitmq
volumes:
- celerybeat-schedule:/var/run/celerybeat-schedule
flower:
# Alternative using public flower image
#image: mher/flower:latest
image: laxy:latest
environment:
- LAXY_DEBUG=no
- LAXY_BROKER_URL=amqp://guest@rabbitmq
# - LAXY_BROKER_URL=redis://redis:6379/0
# - FLOWER_BASIC_AUTH=user:pass
ports:
- "5556:5556"
working_dir: /app
command: sh -c "sleep 30 && celery -A laxy flower --port=5556
--broker=${LAXY_BROKER_URL}"
# entrypoint:
# - celery
# - -A
# - laxy
# - flower
# - --port=5556
# - --broker="${LAXY_BROKER_URL}"
depends_on:
- db
- rabbitmq
- queue-high
- queue-low
nginx:
image: laxy-static-nginx:latest
# Really, django depends on nginx, however because of the way nginx hostname resolution
# works during startup, the django service (and associated internal DNS name) must
# exist BEFORE nginx starts.
depends_on:
- django
splash:
# https://hub.docker.com/layers/scrapinghub/splash/master/images/sha256-02d75b5b052f3d91c2f2b308c1c402bd11464beb3ed0a468253921c2c39b2b8e
image: scrapinghub/splash:master
command: --disable-ui --disable-lua --disable-browser-caches --max-timeout 300
expose:
- "8050"
depends_on:
- django
- queue-high
- queue-low
volumes:
dbdata: null
rabbitmq_data: null
celerybeat-schedule: null