forked from aboutcode-org/purldb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose_purldb.yml
146 lines (133 loc) · 3.14 KB
/
docker-compose_purldb.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
version: "3"
services:
db:
image: postgres:13
env_file:
- docker_purldb.env
volumes:
- db_data:/var/lib/postgresql/data/
redis:
image: redis
command: redis-server --appendonly yes
volumes:
- redis_data:/data
restart: always
web:
build: .
command: sh -c "
python manage_purldb.py migrate &&
python manage_purldb.py collectstatic --no-input --verbosity 0 --clear &&
gunicorn purldb_project.wsgi:application --bind :8000 --timeout 600 --workers 8"
env_file:
- docker_purldb.env
expose:
- 8000
volumes:
- /etc/purldb/:/etc/purldb/
- static:/var/purldb/static/
- temp_data:/tmp/minecode/
depends_on:
- db
visitor:
build: .
command: sh -c "
wait-for-it web:8000 -- python manage_purldb.py seed &&
python manage_purldb.py run_visit --ignore-robots --ignore-throttle"
env_file:
- docker_purldb.env
volumes:
- /etc/purldb/:/etc/purldb/
profiles:
- visit_and_map
depends_on:
- db
- web # Ensure that potential db migrations run first
mapper:
build: .
command: wait-for-it web:8000 -- python manage_purldb.py run_map
env_file:
- docker_purldb.env
volumes:
- /etc/purldb/:/etc/purldb/
profiles:
- visit_and_map
depends_on:
- db
- web # Ensure that potential db migrations run first
clearsync:
build: .
command: wait-for-it web:8000 -- clearsync --save-to-db --verbose -n 3
env_file:
- docker_purldb.env
volumes:
- /etc/purldb/:/etc/purldb/
profiles:
- clearsync
depends_on:
- db
- web # Ensure that potential db migrations run first
clearindex:
build: .
command: wait-for-it web:8000 -- python manage_purldb.py run_clearindex
profiles:
- clearsync
depends_on:
- db
- web # Ensure that potential db migrations run first
priority_queue:
build: .
command: wait-for-it web:8000 -- python manage_purldb.py priority_queue
env_file:
- docker_purldb.env
volumes:
- /etc/purldb/:/etc/purldb/
profiles:
- priority_queue
depends_on:
- db
- web
scheduler:
build: .
command: wait-for-it web:8000 -- python manage_purldb.py run_scheduler
env_file:
- docker_purldb.env
volumes:
- /etc/purldb/:/etc/purldb/
depends_on:
- redis
- db
- web
rq_worker:
build: .
command: wait-for-it web:8000 -- python manage_purldb.py rqworker default
env_file:
- docker_purldb.env
volumes:
- /etc/purldb/:/etc/purldb/
- temp_data:/tmp/minecode/
depends_on:
- redis
- db
- web
nginx:
image: nginx
labels:
- "traefik.enable=true"
- "traefik.http.routers.web.rule=
Host(`127.0.0.1`)
|| Host(`localhost`)"
- "traefik.http.routers.web.entrypoints=web"
volumes:
- ./etc/nginx/conf.d/:/etc/nginx/conf.d/
- static:/var/purldb/static/
depends_on:
- web
networks:
default:
name: purldb
external: true
volumes:
db_data:
static:
redis_data:
temp_data: