-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yaml
103 lines (101 loc) · 2.58 KB
/
docker-compose.yaml
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
services:
db:
image: docker.io/library/postgres
environment:
- POSTGRES_DB=${SQL_DATABASE}
- POSTGRES_USER=${SQL_USER}
- POSTGRES_PASSWORD=${SQL_PASSWORD}
- PGHOST=${SQL_HOST}
- PGPORT=${SQL_PORT}
- PGUSER=${SQL_USER}
- PGDATABASE=${SQL_DATABASE}
- PGPASSWORD=${SQL_PASSWORD}
volumes:
- ianalyzer-db:/var/lib/postgresql/data/
backend:
build:
context: ./backend
depends_on:
- db
- celery
- redis
- elasticsearch
environment:
SQL_DATABASE: $SQL_DATABASE
SQL_USER: $SQL_USER
SQL_PASSWORD: $SQL_PASSWORD
SQL_HOST: $SQL_HOST
SQL_PORT: $SQL_PORT
ES_HOST: $ES_HOST
CELERY_BROKER: $CELERY_BROKER
ports:
- 127.0.0.1:8000:8000
volumes:
- type: bind
source: ./backend
target: /backend
- type: bind
source: $DATA_DIR
target: /corpora
command: bash -c "python manage.py migrate && python manage.py loadcorpora && python manage.py runserver 0.0.0.0:8000"
frontend:
build:
context: ./frontend
ports:
- 127.0.0.1:4200:4200
volumes:
- type: bind
source: ./frontend/src
target: /frontend/src
- type: bind
source: ./frontend/build
target: /frontend/build
command: sh -c "yarn prebuild && yarn start-docker"
elasticsearch:
build:
context: .
dockerfile: DockerfileElastic
environment:
- node.name=ianalyzer-node
- discovery.type=single-node
- cluster.name=ianalizer-es-data-cluster
- bootstrap.memory_lock=true
- xpack.security.enabled=false
- logger.org.elasticsearch.discovery=ERROR
- logger.org.elasticsearch.transport=ERROR
- logger.org.elasticsearch.http=ERROR
- logger.org.elasticsearch.cluster=ERROR
- "ES_JAVA_OPTS=-Xms2g -Xmx2g"
- ELASTIC_PASSWORD=$ELASTIC_ROOT_PASSWORD
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- ianalyzer-es:/usr/share/elasticsearch/data
ports:
- 127.0.0.1:9200:9200
redis:
image: redis:latest
restart: unless-stopped
celery:
build:
context: ./backend
environment:
CELERY_BROKER: $CELERY_BROKER
SQL_DATABASE: $SQL_DATABASE
SQL_USER: $SQL_USER
SQL_PASSWORD: $SQL_PASSWORD
SQL_HOST: $SQL_HOST
ES_HOST: $ES_HOST
volumes:
- type: bind
source: ./backend
target: /backend
command: bash -c "celery -A ianalyzer.celery worker --loglevel=info"
depends_on:
- redis
- db
volumes:
ianalyzer-db:
ianalyzer-es: