-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
139 lines (133 loc) · 3.78 KB
/
Copy pathdocker-compose.yml
File metadata and controls
139 lines (133 loc) · 3.78 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
networks:
frontend:
external: true
app:
driver: bridge
internal: false
services:
nginx:
image: nginxinc/nginx-unprivileged:alpine
networks:
- app
- frontend
depends_on:
e5-large:
condition: service_started
bge-m3:
condition: service_started
bge-reranker:
condition: service_started
authz:
condition: service_healthy
ports:
- '8080'
volumes:
- ./.docker/templates:/etc/nginx/templates:ro
environment:
NGINX_WEB_ROOT: /app
NGINX_PORT: 8080
NGINX_ALLOW_METRICS_IP: "${NGINX_ALLOW_METRICS_IP}"
labels:
- "traefik.enable=true"
- "traefik.docker.network=frontend"
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.rule=Host(`${COMPOSE_DOMAIN}`)"
authz:
image: python:3.12-alpine
networks:
- app
user: "65534:65534"
working_dir: /app
command: python -u app.py
environment:
PYTHONDONTWRITEBYTECODE: "1"
volumes:
- ./.docker/authz/app.py:/app/app.py:ro
- ./.docker/authz/api_keys.txt:/keys/api_keys.txt:ro
healthcheck:
test: [ "CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/healthz').read()" ]
interval: 5s
timeout: 2s
retries: 3
start_period: 3s
bge-m3:
image: michaelf34/infinity:${INFINITY_IMAGE_VERSION:?}
networks:
- app
ports:
- "7997"
environment:
# Shared HF cache so the two services don't re-download overlapping files.
HF_HOME: /hf-cache
HUGGINGFACE_HUB_TOKEN: ${HF_TOKEN:-}
INFINITY_LOG_LEVEL: ${LOG_LEVEL:-info}
volumes:
- ./.docker/data/hf_cache:/hf-cache
command:
- v2
- --model-id=BAAI/bge-m3
- --served-model-name=bge-m3
- --engine=torch
- --dtype=float32
- --device=cpu
- --port=7997
- --batch-size=${BGE_M3_BATCH_SIZE:-8}
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://localhost:7997/health', timeout=2).status==200 else 1)"]
interval: 30s
timeout: 5s
retries: 5
start_period: 180s
e5-large:
image: michaelf34/infinity:${INFINITY_IMAGE_VERSION:?}
networks:
- app
ports:
- "7997"
environment:
HF_HOME: /hf-cache
HUGGINGFACE_HUB_TOKEN: ${HF_TOKEN:-}
INFINITY_LOG_LEVEL: ${LOG_LEVEL:-info}
volumes:
- ./.docker/data/hf_cache:/hf-cache
command:
- v2
- --model-id=intfloat/multilingual-e5-large
- --served-model-name=multilingual-e5-large
- --engine=torch
- --dtype=float32
- --device=cpu
- --port=7997
- --batch-size=${E5_LARGE_BATCH_SIZE:-8}
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://localhost:7997/health', timeout=2).status==200 else 1)"]
interval: 30s
timeout: 5s
retries: 5
start_period: 180s
bge-reranker:
image: michaelf34/infinity:${INFINITY_IMAGE_VERSION:?}
networks:
- app
ports:
- "7997"
environment:
HF_HOME: /hf-cache
HUGGINGFACE_HUB_TOKEN: ${HF_TOKEN:-}
INFINITY_LOG_LEVEL: ${LOG_LEVEL:-info}
volumes:
- ./.docker/data/hf_cache:/hf-cache
command:
- v2
- --model-id=BAAI/bge-reranker-v2-m3
- --served-model-name=bge-reranker-v2-m3
- --engine=torch
- --dtype=float32
- --device=cpu
- --port=7997
- --batch-size=${BGE_RERANKER_BATCH_SIZE:-8}
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://localhost:7997/health', timeout=2).status==200 else 1)"]
interval: 30s
timeout: 5s
retries: 5
start_period: 180s