forked from studyield/studyield
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
125 lines (118 loc) · 3.29 KB
/
docker-compose.yml
File metadata and controls
125 lines (118 loc) · 3.29 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
# Studyield - Full Stack Setup
# Usage: docker compose --env-file .env.docker up
# Then visit http://localhost:5189 (frontend) and http://localhost:3010 (backend API)
services:
# --- Infrastructure -----------------------------------------------
postgres:
image: postgres:15-alpine
container_name: studyield-postgres
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
POSTGRES_DB: ${POSTGRES_DB:-studyield_dev}
ports:
- "${POSTGRES_PORT:-5432}:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
container_name: studyield-redis
restart: unless-stopped
command: redis-server --appendonly yes
ports:
- "${REDIS_PORT:-6379}:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
qdrant:
image: qdrant/qdrant:latest
container_name: studyield-qdrant
restart: unless-stopped
ports:
- "${QDRANT_PORT:-6333}:6333"
- "${QDRANT_GRPC_PORT:-6334}:6334"
volumes:
- qdrant_data:/qdrant/storage
environment:
- QDRANT__SERVICE__GRPC_PORT=6334
clickhouse:
image: clickhouse/clickhouse-server:latest
container_name: studyield-clickhouse
restart: unless-stopped
ports:
- "${CLICKHOUSE_PORT:-8123}:8123"
volumes:
- clickhouse_data:/var/lib/clickhouse
environment:
CLICKHOUSE_DB: ${CLICKHOUSE_DATABASE:-studyield_analytics}
CLICKHOUSE_USER: ${CLICKHOUSE_USER:-default}
CLICKHOUSE_PASSWORD: ${CLICKHOUSE_PASSWORD:-}
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost:8123/ping"]
interval: 10s
timeout: 5s
retries: 5
# --- Application --------------------------------------------------
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: studyield-backend
restart: unless-stopped
ports:
- "${BACKEND_PORT:-3010}:3010"
env_file:
- ./backend/.env
environment:
- NODE_ENV=production
- DATABASE_HOST=postgres
- DATABASE_PORT=5432
- DATABASE_USER=${POSTGRES_USER:-postgres}
- DATABASE_PASSWORD=${POSTGRES_PASSWORD:-postgres}
- DATABASE_NAME=${POSTGRES_DB:-studyield_dev}
- REDIS_HOST=redis
- REDIS_PORT=6379
- QDRANT_HOST=qdrant
- QDRANT_PORT=6333
- CLICKHOUSE_HOST=clickhouse
- CLICKHOUSE_PORT=8123
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
qdrant:
condition: service_started
clickhouse:
condition: service_healthy
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: studyield-frontend
restart: unless-stopped
ports:
- "${FRONTEND_PORT:-5189}:80"
environment:
- VITE_API_URL=http://localhost:${BACKEND_PORT:-3010}
depends_on:
- backend
volumes:
postgres_data:
driver: local
redis_data:
driver: local
qdrant_data:
driver: local
clickhouse_data:
driver: local