-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
175 lines (163 loc) · 5.53 KB
/
docker-compose.yml
File metadata and controls
175 lines (163 loc) · 5.53 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
services:
# main db
mysql:
image: mysql:5.7
platform: linux/amd64
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
platform: linux/amd64
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:
- "${ZEEGUU_DATA_FOLDER}/elasticsearch/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
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:3456/ping || exit 1"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
autoheal:
image: willfarrell/autoheal
restart: always
environment:
- AUTOHEAL_CONTAINER_LABEL=all
volumes:
- /var/run/docker.sock:/var/run/docker.sock
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
- "${ZEEGUU_RESOURCES_FOLDER}/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
stanza:
build: ./stanza_service
volumes:
- ${ZEEGUU_DATA_FOLDER}/stanza_resources:/stanza_resources
environment:
STANZA_RESOURCE_DIR: /stanza_resources
networks:
- zeeguu_backend
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5001/health"]
interval: 30s
timeout: 5s
retries: 3
start_period: 300s # Models take time to load
restart: unless-stopped
# Each worker loads all 15 language models (~8GB)
mem_limit: 10g
# 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
- stanza
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
- ${STIRI_SIMPLE_DEPLOY_PATH:-../../deployments/stiri-simple.github.io}:/deployments/stiri-simple.github.io
# - ./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/
ZEEGUU_RESOURCES_FOLDER: /zeeguu-data/
STANZA_SERVICE_URL: http://stanza:5001
SENTRY_DSN: ${SENTRY_DSN}
YOUTUBE_API_KEY: ${YOUTUBE_API_KEY}
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://embedding_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
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: