-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
74 lines (71 loc) · 1.83 KB
/
docker-compose.yml
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
services:
db:
image: ramsrib/pgvector:16
restart: always
volumes:
- db-data:/var/lib/postgresql/data/pgdata
env_file:
- .env
environment:
- PGDATA=/var/lib/postgresql/data/pgdata
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD?Variable not set}
- POSTGRES_USER=${POSTGRES_USER?Variable not set}
- POSTGRES_DB=${POSTGRES_DB?Variable not set}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
retries: 5
start_period: 30s
timeout: 10s
api:
image: "${API_IMAGE_NAME}:${TAG-latest}"
build:
context: .
restart: always
volumes:
- model-cache-data:/root/.cache/huggingface
depends_on:
db:
condition: service_healthy
restart: true
env_file:
- .env
environment:
- ENVIRONMENT=${ENVIRONMENT}
- POSTGRES_SERVER=db
- POSTGRES_PORT=${POSTGRES_PORT}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER?Variable not set}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD?Variable not set}
healthcheck:
test:
[
"CMD",
"curl",
"-f",
"http://localhost:8000/api/v1/utils/health-check/",
]
interval: 10s
timeout: 5s
retries: 5
prestart:
image: "${API_IMAGE_NAME}:${TAG-latest}"
build:
context: .
depends_on:
db:
condition: service_healthy
restart: true
command: bash scripts/prestart.sh
env_file:
- .env
environment:
- ENVIRONMENT=${ENVIRONMENT}
- POSTGRES_SERVER=db
- POSTGRES_PORT=${POSTGRES_PORT}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER?Variable not set}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD?Variable not set}
volumes:
db-data:
model-cache-data: