-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
122 lines (111 loc) · 2.63 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
version: "3.9"
services:
db:
image: postgres
container_name: db_scholar
volumes:
- ./data/db:/var/lib/postgresql/data
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
restart: always
selenium-hub:
image: selenium/hub
container_name: selenium_scholar
ports:
- "4444:4444"
environment:
GRID_MAX_SESSION: 20
GRID_BROWSER_TIMEOUT: 300
GRID_TIMEOUT: 300
chrome:
image: selenium/node-chrome
container_name: chrome_scholar
depends_on:
- selenium-hub
environment:
HUB_PORT_4444_TCP_ADDR: selenium-hub
HUB_PORT_4444_TCP_PORT: 4444
NODE_MAX_SESSION: 1
NODE_MAX_INSTANCES: 1
firefox:
image: selenium/node-firefox
container_name: firefox_scholar
depends_on:
- selenium-hub
environment:
HUB_PORT_4444_TCP_ADDR: selenium-hub
HUB_PORT_4444_TCP_PORT: 4444
NODE_MAX_SESSION: 10
NODE_MAX_INSTANCES: 10
redis:
image: redis:alpine
container_name: redis_scholar
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 2s
timeout: 3s
retries: 10
celery:
build: .
container_name: celery_scholar
command: celery -A Scholar worker -l info
volumes:
- .:/Scholar
depends_on:
- web
- redis
- db
celery-beat:
build: .
container_name: celery-beat_scholar
command: celery -A Scholar beat -l info
volumes:
- .:/Scholar
depends_on:
- web
- db
- redis
web:
build: .
container_name: web_scholar
volumes:
- .:/Scholar
ports:
- "8000:8000"
environment:
- DEBUG=1
- DJANGO_ALLOWED_HOST=localhost 127.0.0.1
- CELERY_BROKER=redis://redis:6379/0
- CELERY_BACKEND=redis://redis:6379/0
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
command: bash -c "python manage.py makemigrations && python manage.py migrate && python manage.py runserver 0.0.0.0:8000"
restart: on-failure
flower:
image: mher/flower
container_name: flower_scholar
command: ["celery","flower", "--broker=redis://redis:6379/0", "--port=5555"]
ports:
- 5555:5555
depends_on:
- redis
- db
- celery
links:
- redis
- db
environment:
- CELERY_BROKER_API=redis://redis:6379/0
- CELERY_BROKER_URL=redis://redis:6379/0