-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
136 lines (130 loc) · 3.94 KB
/
docker-compose.yml
File metadata and controls
136 lines (130 loc) · 3.94 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
# =============================================================================
# docker-compose.yml — Local Development Environment
#
# Usage:
# docker compose up → Start all services
# docker compose up --build → Rebuild and start
# docker compose down -v → Stop and remove volumes
# docker compose logs -f backend → Follow backend logs
# =============================================================================
services:
# ---------------------------------------------------------------------------
# Frontend — React dev server with hot reload
# ---------------------------------------------------------------------------
frontend:
build:
context: ./frontend
target: builder
dockerfile: Dockerfile
command: npx vite --host 0.0.0.0 --port 3000
ports:
- "3000:3000"
volumes:
- ./frontend/src:/app/src
- ./frontend/index.html:/app/index.html
environment:
- VITE_API_URL=http://localhost:8080
- VITE_API_KEY=${API_AUTH_KEY}
depends_on:
backend:
condition: service_healthy
# ---------------------------------------------------------------------------
# Backend — Node.js API server with hot reload
# ---------------------------------------------------------------------------
backend:
build:
context: ./backend
target: runtime
dockerfile: Dockerfile
ports:
- "8080:8080"
volumes:
- ./backend/src:/app/src
command: node src/server.js
environment:
- NODE_ENV=development
- PORT=8080
- DB_HOST=db
- DB_PORT=5432
- DB_NAME=myapp
- DB_USER=myapp
- DB_PASSWORD=localdev123
- CORS_ORIGIN=http://localhost:3000
- QDRANT_URL=http://qdrant:6333
- QDRANT_COLLECTION=tasks
- LLM_PROVIDER=mock
- LLM_MODEL=gpt-4o-mini
- LLM_MODEL_FAST=gpt-4o-mini
- LLM_MODEL_ACCURATE=gpt-4o
- LLM_EMBED_MODEL=text-embedding-3-small
- LLM_API_BASE=https://api.openai.com/v1
- LLM_VECTOR_SIZE=8
- LLM_ROUTING=length
- LLM_ROUTING_MAX_CHARS=200
- LLM_RATE_LIMIT_WINDOW_MS=60000
- LLM_RATE_LIMIT_MAX=30
- LLM_COST_INPUT_PER_1K=0.00015
- LLM_COST_OUTPUT_PER_1K=0.0006
- LLM_EMBED_COST_PER_1K=0.00002
- LLM_API_KEY=${LLM_API_KEY}
- API_AUTH_KEY=${API_AUTH_KEY}
depends_on:
db:
condition: service_healthy
qdrant:
condition: service_started
healthcheck:
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:8080/health"]
interval: 10s
timeout: 5s
retries: 5
start_period: 15s
# ---------------------------------------------------------------------------
# Database — PostgreSQL
# ---------------------------------------------------------------------------
db:
image: postgres:16-alpine
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
environment:
- POSTGRES_DB=myapp
- POSTGRES_USER=myapp
- POSTGRES_PASSWORD=localdev123
healthcheck:
test: ["CMD-SHELL", "pg_isready -U myapp -d myapp"]
interval: 5s
timeout: 5s
retries: 5
qdrant:
image: qdrant/qdrant:latest
ports:
- "6333:6333"
volumes:
- qdrant_data:/qdrant/storage
healthcheck:
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:6333/healthz"]
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
# ---------------------------------------------------------------------------
# pgAdmin — optional DB UI, start with: docker compose --profile tools up
# ---------------------------------------------------------------------------
pgadmin:
image: dpage/pgadmin4:latest
ports:
- "5050:80"
environment:
- PGADMIN_DEFAULT_EMAIL=admin@myapp.com
- PGADMIN_DEFAULT_PASSWORD=admin
depends_on:
- db
profiles:
- tools
volumes:
pgdata:
driver: local
qdrant_data:
driver: local