-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
137 lines (129 loc) · 4.1 KB
/
docker-compose.yml
File metadata and controls
137 lines (129 loc) · 4.1 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
# Yavio Platform — Docker Compose (Development)
# Starts PostgreSQL + ClickHouse for local development.
# See: .specs/infrastructure/deployment.md §9.1.1
#
# Usage:
# ./scripts/setup-env.sh # generate .env with random secrets
# docker compose up -d
# docker compose ps # verify health checks pass
services:
postgres:
image: postgres:16
restart: unless-stopped
environment:
POSTGRES_DB: yavio
POSTGRES_USER: yavio_service
POSTGRES_PASSWORD: ${POSTGRES_SERVICE_PASSWORD:-yavio_dev}
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "${POSTGRES_PORT:-5432}:5432"
networks:
- backend
healthcheck:
test: ["CMD-SHELL", "pg_isready -U yavio_service"]
interval: 5s
timeout: 5s
retries: 5
clickhouse:
image: clickhouse/clickhouse-server:24.3
restart: unless-stopped
environment:
CLICKHOUSE_PASSWORD: ${CLICKHOUSE_PASSWORD:-yavio_dev}
CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT: 1
volumes:
- clickhouse_data:/var/lib/clickhouse
ports:
- "${CLICKHOUSE_HTTP_PORT:-8123}:8123"
- "${CLICKHOUSE_NATIVE_PORT:-9000}:9000"
networks:
- backend
healthcheck:
test: ["CMD", "clickhouse-client", "--password", "${CLICKHOUSE_PASSWORD:-yavio_dev}", "--query", "SELECT 1"]
interval: 5s
timeout: 5s
retries: 5
migrate:
build:
context: .
dockerfile: packages/db/Dockerfile
environment:
DATABASE_URL: postgres://yavio_service:${POSTGRES_SERVICE_PASSWORD:-yavio_dev}@postgres:5432/yavio
CLICKHOUSE_URL: http://default:${CLICKHOUSE_PASSWORD:-yavio_dev}@clickhouse:8123
networks:
- backend
depends_on:
postgres:
condition: service_healthy
clickhouse:
condition: service_healthy
ingest:
build:
context: .
dockerfile: packages/ingest/Dockerfile
restart: unless-stopped
environment:
DATABASE_URL: postgres://yavio_service:${POSTGRES_SERVICE_PASSWORD:-yavio_dev}@postgres:5432/yavio
CLICKHOUSE_URL: http://default:${CLICKHOUSE_PASSWORD:-yavio_dev}@clickhouse:8123
API_KEY_HASH_SECRET: ${API_KEY_HASH_SECRET}
JWT_SECRET: ${JWT_SECRET}
PORT: "3001"
ports:
- "${INGEST_PORT:-3001}:3001"
networks:
- frontend
- backend
depends_on:
migrate:
condition: service_completed_successfully
healthcheck:
test: ["CMD-SHELL", "node -e \"fetch('http://localhost:3001/health').then(r=>{process.exit(r.ok?0:1)}).catch(()=>process.exit(1))\""]
interval: 5s
timeout: 5s
retries: 5
dashboard:
build:
context: .
dockerfile: packages/dashboard/Dockerfile
restart: unless-stopped
environment:
DATABASE_URL: postgres://yavio_service:${POSTGRES_SERVICE_PASSWORD:-yavio_dev}@postgres:5432/yavio
CLICKHOUSE_URL: http://default:${CLICKHOUSE_PASSWORD:-yavio_dev}@clickhouse:8123
NEXTAUTH_URL: ${NEXTAUTH_URL:-http://localhost:3000}
NEXTAUTH_SECRET: ${NEXTAUTH_SECRET}
API_KEY_HASH_SECRET: ${API_KEY_HASH_SECRET}
APP_URL: ${APP_URL:-http://localhost:3000}
ENCRYPTION_KEY: ${ENCRYPTION_KEY}
ports:
- "${DASHBOARD_PORT:-3000}:3000"
networks:
- frontend
- backend
depends_on:
migrate:
condition: service_completed_successfully
healthcheck:
test: ["CMD-SHELL", "node -e \"fetch('http://localhost:3000/api/health').then(r=>{process.exit(r.ok?0:1)}).catch(()=>process.exit(1))\""]
interval: 10s
timeout: 5s
retries: 3
docs:
build:
context: .
dockerfile: packages/docs/Dockerfile
restart: unless-stopped
ports:
- "${DOCS_PORT:-3002}:3000"
networks:
- frontend
healthcheck:
test: ["CMD-SHELL", "node -e \"fetch('http://localhost:3000').then(r=>{process.exit(r.ok?0:1)}).catch(()=>process.exit(1))\""]
interval: 10s
timeout: 5s
retries: 3
volumes:
postgres_data:
clickhouse_data:
networks:
frontend: # Public-facing services (ingest, dashboard) — added when app services are introduced
backend: # Internal services (databases)