-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.production.yml
More file actions
75 lines (72 loc) · 1.98 KB
/
docker-compose.production.yml
File metadata and controls
75 lines (72 loc) · 1.98 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
services:
app:
build:
context: .
dockerfile: Dockerfile
target: runner
args:
OPENAI_API_KEY: ${OPENAI_API_KEY}
ports:
- "127.0.0.1:3000:3000"
environment:
- NODE_ENV=production
- OPENAI_API_KEY=${OPENAI_API_KEY}
- PGHOST=postgres
- PGPORT=5432
- PGUSER=${POSTGRES_USER:-pat_user}
- PGPASSWORD=${POSTGRES_PASSWORD}
- PGDATABASE=${POSTGRES_DB:-pat_db}
depends_on:
- postgres
volumes:
- ./data:/app/data:ro
restart: always
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:3000 || exit 1"]
interval: 30s
timeout: 10s
retries: 3
postgres:
image: pgvector/pgvector:pg16
environment:
- POSTGRES_USER=${POSTGRES_USER:-pat_user}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB:-pat_db}
volumes:
- postgres_data:/var/lib/postgresql/data
- ./init-db:/docker-entrypoint-initdb.d
restart: always
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-pat_user} -d ${POSTGRES_DB:-pat_db}"]
interval: 10s
timeout: 5s
retries: 5
seeder:
build:
context: .
dockerfile: Dockerfile
target: runner
args:
OPENAI_API_KEY: ${OPENAI_API_KEY}
environment:
- OPENAI_API_KEY=${OPENAI_API_KEY}
- PGHOST=postgres
- PGPORT=5432
- PGUSER=${POSTGRES_USER:-pat_user}
- PGPASSWORD=${POSTGRES_PASSWORD}
- PGDATABASE=${POSTGRES_DB:-pat_db}
- DOWNLOAD_DATA=${DOWNLOAD_DATA:-true}
- PAT_DATA_REPO=${PAT_DATA_REPO:-https://github.com/Vassar-Cognitive-Science/pat-data.git}
- CHUNK_SIZE=${CHUNK_SIZE:-2500}
- OVERLAP_SENTENCES=${OVERLAP_SENTENCES:-2}
depends_on:
postgres:
condition: service_healthy
volumes:
- ./init-db:/app/init-db
- ./data:/app/data
command: ["node", "/app/init-db/03-seed-embeddings.js"]
profiles:
- seeding
volumes:
postgres_data: