-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
139 lines (132 loc) · 3.6 KB
/
docker-compose.yml
File metadata and controls
139 lines (132 loc) · 3.6 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
volumes:
postgres_data:
valkey_data:
services:
triton:
restart: unless-stopped
build:
context: ./triton
volumes:
- ./triton/model-repository:/models
- ./triton/engines:/engines
command: [
"tritonserver",
"--model-repository=/models",
]
environment:
MAX_LENGTH: ${MAX_LENGTH}
TASK_DESCRIPTION: ${TASK_DESCRIPTION}
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/v2/health/ready"]
interval: 30s
timeout: 10s
retries: 5
start_period: 30s
cache:
restart: unless-stopped
image: valkey/valkey:8.1-alpine3.21
volumes:
- valkey_data:/data
environment:
VALKEY_EXTRA_FLAGS: --save 60 1 --loglevel warning
healthcheck:
test: ["CMD", "valkey-cli", "ping"]
interval: 30s
timeout: 10s
retries: 5
tgi:
restart: unless-stopped
image: ghcr.io/huggingface/text-generation-inference:2.4.1
environment:
- QUANTIZE=eetq
- MODEL_ID=${LLM_MODEL}
volumes:
- ./tgi/model:/data
shm_size: 2gb
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:80/health"]
interval: 10s
timeout: 5s
retries: 100
api:
restart: unless-stopped
depends_on:
triton:
condition: service_healthy
tgi:
condition: service_healthy
cache:
condition: service_healthy
image: "mousse/search-service:${VERSION}"
build:
context: ./backend
target: production
args:
VERSION: "${VERSION}"
environment:
- ROOT_PATH=${ROOT_PATH:-}
- DB_URI=postgresql+asyncpg://${POSTGRES_APP_USER}:${POSTGRES_APP_USER_PASS}@db:5432/${POSTGRES_DB}
- TRITON_URL=triton
- TRITON_GRPC_PORT=8881
- TRITON_MODEL_NAME=${INFERENCE_MODEL_NAME}
- CACHE_URL=cache:6379
- CHAT_COMPLETION_URL=http://tgi:80
volumes:
- ./data:/var/local/data:ro
- ./model-repository:/var/local/models:ro
db:
image: "mousse/postgres:16.4-postgis-pgvector"
restart: unless-stopped
build:
context: ./postgresql
ports:
- 5432:5432
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_APP_USER: ${POSTGRES_APP_USER}
POSTGRES_APP_USER_PASS: ${POSTGRES_APP_USER_PASS}
POSTGRES_APP_SCHEMA: core
RUN_AS_ROOT: false
healthcheck:
test: "PGPASSWORD=${POSTGRES_PASSWORD} pg_isready -h 127.0.0.1 -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB}"
migrate:
image: "mousse/search-service:${VERSION}"
build:
context: ./backend
target: production
depends_on:
db:
condition: service_healthy
environment:
- DB_URI=postgresql+asyncpg://${POSTGRES_APP_USER}:${POSTGRES_APP_USER_PASS}@db:5432/${POSTGRES_DB}
working_dir: /usr/local/api
entrypoint: bash -c "alembic upgrade head"
profiles:
- manual
volumes:
- ./data:/var/local/data:ro
ingest:
image: "mousse/search-service:${VERSION}"
build:
context: ./backend
target: production
depends_on:
db:
condition: service_healthy
environment:
- DB_URI=postgresql+asyncpg://${POSTGRES_APP_USER}:${POSTGRES_APP_USER_PASS}@db:5432/${POSTGRES_DB}
working_dir: /usr/local/api
entrypoint: [ "bash", "-c", "mousse $1 $2", "--" ]
profiles:
- manual