forked from zeeguu/api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
138 lines (128 loc) · 4.37 KB
/
docker-compose.yml
File metadata and controls
138 lines (128 loc) · 4.37 KB
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
services:
# main db
mysql:
image: mysql:5.7
volumes:
- ${ZEEGUU_DATA_FOLDER}/mysql:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: ${ZEEGUU_MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${ZEEGUU_MYSQL_DB}
MYSQL_USER: ${ZEEGUU_MYSQL_USER}
MYSQL_PASSWORD: ${ZEEGUU_MYSQL_USER_PASSWORD}
networks:
- zeeguu_backend
ports:
- "3306:3306"
restart: unless-stopped
# main db
fmd_mysql:
image: mysql:5.7
volumes:
- ${ZEEGUU_DATA_FOLDER}/fmd_mysql:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: ${FMD_ROOT_PASS}
MYSQL_DATABASE: ${FMD_MYSQL_DB}
MYSQL_USER: ${FMD_MYSQL_USER}
MYSQL_PASSWORD: ${FMD_MYSQL_USER_PASS}
networks:
- zeeguu_backend
restart: unless-stopped
elasticsearch_v8:
image: elasticsearch:8.12.2
platform: linux/amd64
# ports:
# - 9200:9200
# - 9300:9300
# Ports don't have to be exposed, but it can be nice to debug.
environment:
- discovery.type=single-node
- xpack.security.enabled=false
volumes:
- ./data/elasticsearch_db_v8/data:/usr/share/elasticsearch/data
networks:
- zeeguu_backend
restart: unless-stopped
mem_limit: 512m # Useful to restrict the ammount of RAM used by ES.
readability_server:
image: zeeguu/readability_server
networks:
- zeeguu_backend
restart: unless-stopped
embedding_api:
image: zeeguu/semantic-emb-api:main
# deploy:
# resources:
# limits:
# cpus: '0.50'
environment:
SEMANTIC_EMB_API_PORT: 3654
# ports:
# - 3654:3654
# Ports don't have to be exposed, but it can be nice to debug.
entrypoint: "python ./semantic-emb-api/app/app.py"
volumes:
- .:/Zeeguu-API
- ./data/zeeguu/language-models:/semantic-emb-api/semantic-emb-api/app/semantic_vector/binaries
networks:
- zeeguu_backend
# When encoding certain longer documents, it might use more than
# the available memory allocated to the container, in that case restart the service.
mem_limit: 2512m # From testing usually the container needs about 2GBs to run
# However, as a Dev safeguard, if needed the container is restarted to avoid
# taking too much memory from the host.
restart: unless-stopped
# yaml-anchors:
# https://support.atlassian.com/bitbucket-cloud/docs/yaml-anchors/
zapi: &zapi_default
depends_on:
- mysql
- fmd_mysql
- elasticsearch_v8
- readability_server
- embedding_api
image: zeeguu/api:latest
build: .
ports:
- "127.0.0.1:8080:8080"
# to consider mapping only to localhost cf here:
# https://serverfault.com/questions/681571/docker-exposed-ports-accessible-from-outside-iptables-rules-ignored
# otherwise the port is visible from the outside; even against ufw rules!
volumes:
- .:/Zeeguu-API
- ${ZEEGUU_DATA_FOLDER}:/zeeguu-data
# - ./api.cfg:/Zeeguu-API/api.cfg
# - ./fmd.cfg:/Zeeguu-API/fmd.cfg
# - ./lu-mir-zeeguu-credentials.json:/Zeeguu-API/lu-mir-zeeguu-credentials.json
environment: &zapi_env
ZEEGUU_CONFIG: /Zeeguu-API/api.cfg
ZEEGUU_DATA_FOLDER: /zeeguu-data/
SENTRY_DSN: ${SENTRY_DSN}
FLASK_MONITORING_DASHBOARD_CONFIG: /Zeeguu-API/fmd.cfg
MICROSOFT_TRANSLATE_API_KEY: ${MICROSOFT_TRANSLATE_API_KEY}
GOOGLE_TRANSLATE_API_KEY: ${GOOGLE_TRANSLATE_API_KEY}
GOOGLE_APPLICATION_CREDENTIALS: /Zeeguu-API/lu-mir-zeeguu-credentials.json
WORDNIK_API_KEY: ${WORDNIK_API_KEY}
MULTI_LANG_TRANSLATOR_AB_TESTING: ${MULTI_LANG_TRANSLATOR_AB_TESTING}
ZEEGUU_ES_CONN_STRING: "http://elasticsearch_v8:9200"
ZEEGUU_EMB_API_CONN_STRING: "http://semantic_emb_api:3654"
# TODO: remove these two envvars and simply use the $ZEEGUU_DATA_FOLDER
FOLDER_FOR_REPORT_OUTPUT: /zeeguu-data/crawl-reports
CRAWL_REPORT_DATA: /zeeguu-data/crawl-reports/data
command: /usr/sbin/apache2ctl -D FOREGROUND
networks:
- zeeguu_backend
restart: unless-stopped
# TODO: align with the docker-compose in ops which has here a logging configuration
zapi_dev: &zapi_dev
<<: *zapi_default
ports:
- "127.0.0.1:8080:9001"
command: python /Zeeguu-API/start.py
zapi_dev_translations:
<<: *zapi_dev
environment:
<<: *zapi_env
DEV_SKIP_TRANSLATION: 1
# TODO add the zapi_pink back
networks:
zeeguu_backend: