-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
124 lines (118 loc) · 3.06 KB
/
Copy pathdocker-compose.yml
File metadata and controls
124 lines (118 loc) · 3.06 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
services:
ai_service:
build:
context: .
dockerfile: ai.dockerfile
args:
# The embedding model is gated on HuggingFace, so the token is needed
# at BUILD time to bake the weights into the image. env_file only
# applies at runtime, which is too late.
HF_TOKEN: ${HF_TOKEN:-}
ports:
- "5000:8000"
env_file:
- .env
environment:
- PYTHONPATH=/app/src
volumes:
# Uploaded files, generated reports, and extracted framework JSONs
# must survive container rebuilds.
- ai_data:/app/data
- ai_config:/app/config
depends_on:
vector_db:
condition: service_started
restart: unless-stopped
healthcheck:
test:
[
"CMD",
"python",
"-c",
"import urllib.request; urllib.request.urlopen('http://localhost:8000/health')",
]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
# One-shot: creates the tables in a fresh database. The frontend crashes on
# its first query without this, so it waits for the push to exit cleanly.
migrate:
build:
context: .
dockerfile: next.dockerfile
target: builder
working_dir: /app/packages/db
environment:
- POSTGRES_URL=postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD}@application_db:5432/${POSTGRES_DB:-app_db}
command: ["pnpm", "exec", "drizzle-kit", "push", "--force"]
depends_on:
application_db:
condition: service_healthy
restart: "no"
frontend:
build:
context: .
dockerfile: next.dockerfile
ports:
- "5001:3000"
env_file:
- .env
environment:
- NODE_ENV=production
- AI_SERVICE_URL=http://ai_service:8000
- POSTGRES_URL=postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD}@application_db:5432/${POSTGRES_DB:-app_db}
depends_on:
ai_service:
condition: service_started
application_db:
condition: service_healthy
migrate:
condition: service_completed_successfully
restart: unless-stopped
vector_db:
image: qdrant/qdrant:latest
restart: unless-stopped
container_name: qdrant
ports:
- "6333:6333"
- "6334:6334"
expose:
- 6333
- 6334
- 6335
configs:
- source: qdrant_config
target: /qdrant/config/production.yaml
volumes:
- qdrant_data:/qdrant/storage
application_db:
image: postgres:15
restart: always
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password}
POSTGRES_DB: ${POSTGRES_DB:-app_db}
ports:
- "5432:5432"
volumes:
- db_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 30s
timeout: 10s
retries: 5
start_period: 30s
configs:
qdrant_config:
content: |
log_level: INFO
volumes:
db_data:
driver: local
qdrant_data:
driver: local
ai_data:
driver: local
ai_config:
driver: local