-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
163 lines (156 loc) · 5.48 KB
/
docker-compose.yml
File metadata and controls
163 lines (156 loc) · 5.48 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
151
152
153
154
155
156
157
158
159
160
161
162
163
services:
# ---------------------------------------------------------------------------
# ClickHouse — columnar data warehouse (pre-loaded with raw ad-tech data)
# ---------------------------------------------------------------------------
clickhouse:
image: clickhouse/clickhouse-server:24.8
ports:
- "8123:8123" # HTTP interface (used by dbt-clickhouse)
- "9000:9000" # Native protocol
volumes:
- clickhouse-data:/var/lib/clickhouse
- ./clickhouse/init-db.sql:/docker-entrypoint-initdb.d/init-db.sql:ro
- ./clickhouse/users.xml:/etc/clickhouse-server/users.d/default-user.xml:ro
ulimits:
nofile:
soft: 262144
hard: 262144
healthcheck:
test: ["CMD", "clickhouse-client", "--query", "SELECT 1"]
interval: 5s
timeout: 3s
retries: 30
# ---------------------------------------------------------------------------
# PostgreSQL — Lightdash internal metadata store
# ---------------------------------------------------------------------------
lightdash-db:
image: postgres:15
environment:
POSTGRES_PASSWORD: ${PGPASSWORD:-lightdash}
POSTGRES_USER: ${PGUSER:-lightdash}
POSTGRES_DB: ${PGDATABASE:-lightdash}
POSTGRES_HOST_AUTH_METHOD: trust
volumes:
- lightdash-db-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${PGUSER:-lightdash}"]
interval: 5s
timeout: 3s
retries: 30
# ---------------------------------------------------------------------------
# MinIO — S3-compatible object storage for Lightdash
# ---------------------------------------------------------------------------
minio:
image: minio/minio:latest
command: server /data --console-address ":9001"
ports:
- "9002:9000" # S3 API
- "9001:9001" # Console (optional, for debugging)
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
volumes:
- minio-data:/data
healthcheck:
test: ["CMD", "mc", "ready", "local"]
interval: 5s
timeout: 3s
retries: 30
minio-init:
image: minio/mc:latest
depends_on:
minio:
condition: service_healthy
entrypoint: >
/bin/sh -c "
mc alias set myminio http://minio:9000 minioadmin minioadmin;
mc mb myminio/lightdash --ignore-existing;
exit 0;
"
# ---------------------------------------------------------------------------
# Lightdash — open-source BI / semantic layer (dbt-native)
# ---------------------------------------------------------------------------
lightdash:
image: lightdash/lightdash:latest
platform: linux/amd64
ports:
- "${LIGHTDASH_PORT:-8880}:8080"
environment:
- PGHOST=${PGHOST:-lightdash-db}
- PGPORT=${PGPORT:-5432}
- PGUSER=${PGUSER:-lightdash}
- PGPASSWORD=${PGPASSWORD:-lightdash}
- PGDATABASE=${PGDATABASE:-lightdash}
- LIGHTDASH_SECRET=${LIGHTDASH_SECRET:-notverysecret}
- SITE_URL=${SITE_URL:-http://localhost:8880}
- S3_REGION=${S3_REGION:-us-east-1}
- S3_BUCKET=${S3_BUCKET:-lightdash}
- S3_ENDPOINT=${S3_ENDPOINT:-http://minio:9000}
- S3_ACCESS_KEY=${S3_ACCESS_KEY:-minioadmin}
- S3_SECRET_KEY=${S3_SECRET_KEY:-minioadmin}
- S3_FORCE_PATH_STYLE=true
- AWS_S3_FORCE_PATH_STYLE=true
- ALLOW_MULTIPLE_ORGS=${ALLOW_MULTIPLE_ORGS:-false}
- LIGHTDASH_MAX_PAYLOAD=${LIGHTDASH_MAX_PAYLOAD:-5mb}
- DBT_PROJECT_DIR=/usr/app/dbt
volumes:
- ./dbt:/usr/app/dbt
depends_on:
lightdash-db:
condition: service_healthy
minio-init:
condition: service_completed_successfully
clickhouse:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "node -e \"const h=require('http');h.get('http://localhost:8080/api/v1/livez',r=>{process.exit(r.statusCode===200?0:1)}).on('error',()=>process.exit(1))\""]
interval: 5s
timeout: 3s
retries: 60
start_period: 30s
# ---------------------------------------------------------------------------
# Lightdash setup — creates default user, org, and project automatically
# ---------------------------------------------------------------------------
lightdash-setup:
profiles: ["setup"]
build:
context: ./lightdash
dockerfile: Dockerfile.setup
volumes:
- ./lightdash/setup.py:/setup.py:ro
- ./lightdash:/lightdash:ro
environment:
- LIGHTDASH_URL=http://lightdash:8080
- ADMIN_EMAIL=${ADMIN_EMAIL:-admin@lightdash.com}
- ADMIN_PASSWORD=${ADMIN_PASSWORD:-admin123!}
- ORG_NAME=Venatus
- PROJECT_NAME=Ad Analytics
- CLICKHOUSE_HOST=clickhouse
- CLICKHOUSE_PORT=8123
- CLICKHOUSE_USER=default
- CLICKHOUSE_PASSWORD=
depends_on:
lightdash:
condition: service_healthy
# ---------------------------------------------------------------------------
# dbt — runs dbt commands against ClickHouse (utility container)
# Usage: docker compose run --rm dbt <dbt-command>
# ---------------------------------------------------------------------------
dbt:
build: ./dbt
profiles: ["dbt"]
volumes:
- ./dbt:/usr/app/dbt
working_dir: /usr/app/dbt
depends_on:
clickhouse:
condition: service_healthy
environment:
- CLICKHOUSE_HOST=clickhouse
- CLICKHOUSE_PORT=8123
- CLICKHOUSE_USER=default
- CLICKHOUSE_PASSWORD=
volumes:
clickhouse-data:
lightdash-db-data:
minio-data: