forked from ResearchHub/researchhub-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
88 lines (86 loc) · 2.33 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
version: '3.8'
x-env: &env
DB_HOST: postgres
DB_USER: rh_developer
DB_PASS: not_secure
REDIS_HOST: redis
ELASTICSEARCH_HOST: http://elasticsearch:9200
services:
helper:
image: researchhub-backend
command: sh -c "echo never > /sys/kernel/mm/transparent_hugepage/enabled"
privileged: true
postgres:
image: postgres:14.1-alpine
restart: always
ports:
- '5433:5432'
environment:
- POSTGRES_DB=researchhub
- POSTGRES_USER=rh_developer
- POSTGRES_PASSWORD=not_secure
volumes:
- db:/var/lib/postgresql/data
migrations:
image: researchhub-backend
environment: *env
command: >
sh -c "
python manage.py makemigrations && python manage.py migrate
"
depends_on:
- postgres
setup:
image: researchhub-backend
environment: *env
command: >
sh -c "
python manage.py collectstatic --noinput &&
python manage.py setup
"
depends_on:
migrations:
condition: service_completed_successfully
backend:
image: researchhub-backend
environment: *env
command:
sh -c '
watchmedo auto-restart --recursive --pattern="*.py;*.env;*.html" --directory="." python manage.py runserver -- 0.0.0.0:8080'
ports:
- '8000:8080'
depends_on:
- setup
- elasticsearch
volumes:
- ./src:/usr/app/src
redis:
image: researchhub-backend
restart: always
ports:
- '6380:6379'
command: redis-server --protected-mode no
celery:
image: researchhub-backend
environment: *env
restart: always
command: celery -A researchhub worker -Q default,paper_metadata,caches,hot_score,elastic_search,external_reporting,notifications,paper_misc,cermine,twitter,pull_papers,logs,purchases,contributions,author_claim -l info --concurrency=1 --prefetch-multiplier=1 -P prefork --uid=nobody --gid=nogroup
depends_on:
- setup
- redis
- elasticsearch
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.1
restart: always
volumes:
- esdata:/usr/share/elasticsearch/data
environment:
- discovery.type=single-node
# Comment out this section if you want to see Elasticsearch logs
logging:
driver: "none"
volumes:
db:
driver: local
esdata:
driver: local