-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
150 lines (142 loc) · 4.06 KB
/
docker-compose.yml
File metadata and controls
150 lines (142 loc) · 4.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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
version: '3.8'
services:
# ==========================================================================
# Backend API Service
# ==========================================================================
api:
build:
context: ./apps/api
dockerfile: Dockerfile
container_name: spotfinder-api
ports:
- "8080:8080"
environment:
- ENVIRONMENT=development
- DEBUG=true
- DATABASE_URL=postgresql+asyncpg://postgres:postgres@postgres:5432/spotfinder_db
- REDIS_URL=redis://redis:6379/0
- QDRANT_URL=http://qdrant:6333
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
qdrant:
condition: service_started
volumes:
- ./apps/api/src:/app/src:ro
networks:
- spotfinder-network
restart: unless-stopped
# ==========================================================================
# Web Frontend Service (Next.js)
# ==========================================================================
web:
build:
context: ./apps/web
dockerfile: Dockerfile
container_name: spotfinder-web
ports:
- "3000:3000"
environment:
- NODE_ENV=production
- NEXT_PUBLIC_API_URL=http://api:8080
depends_on:
- api
networks:
- spotfinder-network
restart: unless-stopped
# ==========================================================================
# PostgreSQL Database
# ==========================================================================
postgres:
image: postgres:16-alpine
container_name: spotfinder-postgres
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: spotfinder_db
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./migrations:/docker-entrypoint-initdb.d:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
networks:
- spotfinder-network
restart: unless-stopped
# ==========================================================================
# Redis (Event Queue, Cache, Rate Limiting)
# ==========================================================================
redis:
image: redis:7-alpine
container_name: spotfinder-redis
command: redis-server --appendonly yes
ports:
- "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
networks:
- spotfinder-network
restart: unless-stopped
# ==========================================================================
# Qdrant Vector Database
# ==========================================================================
qdrant:
image: qdrant/qdrant:latest
container_name: spotfinder-qdrant
ports:
- "6333:6333"
- "6334:6334"
volumes:
- qdrant_data:/qdrant/storage
environment:
- QDRANT__SERVICE__GRPC_PORT=6334
networks:
- spotfinder-network
restart: unless-stopped
# ==========================================================================
# vLLM Server (Optional - for local development)
# Note: Requires GPU. Comment out if using external vLLM server.
# ==========================================================================
# vllm:
# image: vllm/vllm-openai:latest
# container_name: spotfinder-vllm
# runtime: nvidia
# environment:
# - NVIDIA_VISIBLE_DEVICES=all
# command: >
# --model Qwen/Qwen2.5-7B-Instruct
# --port 8000
# --host 0.0.0.0
# --trust-remote-code
# ports:
# - "8000:8000"
# volumes:
# - vllm_cache:/root/.cache/huggingface
# networks:
# - spotfinder-network
# deploy:
# resources:
# reservations:
# devices:
# - driver: nvidia
# count: 1
# capabilities: [gpu]
volumes:
postgres_data:
redis_data:
qdrant_data:
# vllm_cache:
networks:
spotfinder-network:
driver: bridge