-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.prod.yml
98 lines (96 loc) · 2.28 KB
/
docker-compose.prod.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
version: '3.8'
services:
django:
build:
context: ./fancy_web_scrapping
dockerfile: Dockerfile.prod
command: gunicorn fancy_web_scrapping.wsgi:application --bind 0.0.0.0:8000
volumes:
- static_volume:/home/fancy_web_scrapping/django/staticfiles
- media_volume:/home/fancy_web_scrapping/django/mediafiles
expose:
- 8000
environment:
- SERVICE_NAME=django
env_file:
- ./.env.prod
depends_on:
- redis
- db
- selenium-hub
celery:
build: ./fancy_web_scrapping
command: celery -A fancy_web_scrapping worker --loglevel=info --concurrency 10 -E --uid=nobody --gid=nogroup
volumes:
- ./fancy_web_scrapping/:/usr/src/fancy_web_scrapping/
env_file:
- ./.env.dev
depends_on:
- django
- redis
dashboard:
build: ./fancy_web_scrapping
command: celery flower -A fancy_web_scrapping --port=5555 --broker=redis://redis:6379/0
ports:
- 5555:5555
env_file:
- ./.env.dev
depends_on:
- django
- redis
- celery
redis:
image: redis:7-alpine
expose:
- 6379
deploy:
resources:
limits:
memory: 512M
chrome:
image: selenium/node-chrome:4.7.2-20221219
shm_size: 4gb
depends_on:
- selenium-hub
environment:
- SE_EVENT_BUS_HOST=selenium-hub
- SE_EVENT_BUS_PUBLISH_PORT=4442
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
- SE_NODE_MAX_SESSIONS=10
# chrome_video:
# image: selenium/video:ffmpeg-4.3.1-20221219
# volumes:
# - /tmp/videos:/videos
# depends_on:
# - chrome
# environment:
# - DISPLAY_CONTAINER_NAME=chrome
# - FILE_NAME=chrome_video.mp4
selenium-hub:
image: selenium/hub:4.7.2-20221219
container_name: selenium-hub
ports:
- 4442:4442
- 4443:4443
- 4444:4444
db:
image: postgres:13.0-alpine
volumes:
- postgres_data:/var/lib/postgresql/data/
env_file:
- ./.env.prod.db
expose:
- 5432
nginx:
build: ./nginx
volumes:
- static_volume:/home/fancy_web_scrapping/django/staticfiles
- media_volume:/home/fancy_web_scrapping/django/mediafiles
ports:
- 1337:80
depends_on:
- django
volumes:
postgres_data:
static_volume:
media_volume: