-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yml
More file actions
51 lines (48 loc) · 1.77 KB
/
compose.yml
File metadata and controls
51 lines (48 loc) · 1.77 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
# This compose reuses an image for multiple containers. Because of this it should be built in advance with:
# docker build -t bogoslov .
services:
proxy:
image: nginx:1-alpine-slim
ports:
- ${PUBLIC_PORT}:80
volumes:
- ./static:/usr/share/nginx/html:ro
- ./corpora.${CORPUS_LANG}:/usr/share/nginx/static/corpora:ro
- ./results:/usr/share/nginx/static/results:ro
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
healthcheck:
test: ["CMD-SHELL", "wget -nv -t1 --spider http://localhost || exit 1"]
restart: always
service:
image: bogoslov
# ports:
# - 8781:8000
environment:
- DEPLOY_PORT=${PUBLIC_PORT}
- DEPLOY_HOST=${PUBLIC_HOST}
- LANG_CORPUS=${CORPUS_LANG}
- HF_HOME=/models/
volumes:
- ./static/${CORPUS_LANG}.css:/static/${CORPUS_LANG}.css:ro
- ./results:/results
- ./static/alphabet.${CORPUS_LANG}.tsv:/home/app/alphabet.${CORPUS_LANG}.tsv:ro
- ./models:/models/
- ./config.toml:/home/app/config.toml:ro
command: ["python", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
restart: always
healthcheck:
test: ["CMD-SHELL", "python -c \"import json; from urllib.request import urlopen; r = urlopen('http://localhost:8000/settings'); r.status >= 400 and json.load(r)['language'] == '${CORPUS_LANG}'\""]
db:
image: pgvector/pgvector:pg17
environment:
- POSTGRES_DB=bogoslov
- POSTGRES_USER=bogoslov
- POSTGRES_HOST_AUTH_METHOD=trust
ports:
- 5732:5432
volumes:
- ./db/data.${CORPUS_LANG}/:/var/lib/postgresql/data/
- ./db/init.${CORPUS_LANG}/:/docker-entrypoint-initdb.d/:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -d bogoslov -U bogoslov"]
restart: always