-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.override.yml.example
More file actions
376 lines (341 loc) · 12.1 KB
/
Copy pathdocker-compose.override.yml.example
File metadata and controls
376 lines (341 loc) · 12.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
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
# docker-compose.override.yml.example
#
# This file demonstrates how to override default configurations
# Copy to docker-compose.override.yml and customize as needed
#
# Usage: docker compose up -d (will automatically use override file)
version: '3.8'
# ==============================================================================
# ENVIRONMENT VARIABLES - Copy these to your .env file and customize
# ==============================================================================
# HOST_IP=192.168.1.100 # Set for remote server access
# LAKEHOUSE_ROOT=./lakehouse-data # Data directory location
# POSTGRES_MEMORY_LIMIT=4G # PostgreSQL memory allocation
# SPARK_WORKER_MEMORY=16g # Spark worker memory per instance
# SUPERSET_WORKERS=8 # Superset worker processes
services:
# ==============================================================================
# REMOTE SERVER ACCESS CONFIGURATION
# ==============================================================================
# Example: Configure lakehouse-init for remote server deployment
lakehouse-init:
environment:
# Override HOST_IP for specific server deployment
- HOST_IP=your.server.ip.address
# Use external storage for larger deployments
- LAKEHOUSE_ROOT=/mnt/lakehouse-storage
# Adjust timeouts for slower networks
- MINIO_READY_TIMEOUT=30
- MINIO_READY_INTERVAL=5
# ==============================================================================
# ENHANCED SERVICE CONFIGURATIONS
# ==============================================================================
# Example: Enhanced MinIO configuration with SSL
minio:
volumes:
- ./ssl-certs:/certs:ro
environment:
- MINIO_OPTS=--certs-dir /certs
# Add extra environment variables
# - MINIO_BROWSER_REDIRECT_URL=https://your-domain.com:9001
# Example: Custom Spark configuration and dependencies
spark-master:
environment:
# Increase memory for master
- SPARK_MASTER_MEMORY=4g
- SPARK_MASTER_CORES=4
volumes:
# Add custom Spark configuration
- ./custom-spark-conf:/opt/spark/conf/custom:ro
# Add custom JAR files
- ./custom-spark-jars:/opt/spark/jars/custom:ro
spark-worker:
environment:
# Custom worker memory and cores
- SPARK_WORKER_MEMORY=16g
- SPARK_WORKER_CORES=8
# Add custom classpath
- SPARK_CLASSPATH=/opt/spark/jars/custom/*
volumes:
# Mount custom JAR files (same as master)
- ./custom-spark-jars:/opt/spark/jars/custom:ro
# Mount custom datasets for local processing
- ./local-datasets:/opt/datasets:ro
# Example: Enhanced Jupyter configuration with DuckDB 1.3.2
jupyter:
environment:
# NOTE: JUPYTER_TOKEN is auto-generated - see ./scripts/show-credentials.sh
# Custom Jupyter token (optional override)
# - JUPYTER_TOKEN=your-custom-token
# Enable Jupyter extensions
- JUPYTER_ENABLE_LAB=yes
# Enhanced Spark settings for large analytics
- SPARK_DRIVER_MEMORY=8g
- SPARK_EXECUTOR_MEMORY=8g
- SPARK_EXECUTOR_CORES=4
- SPARK_DRIVER_MAX_RESULT_SIZE=4g
# DuckDB configuration for data lake analytics
- DUCKDB_MEMORY_LIMIT=8GB
- DUCKDB_THREADS=4
volumes:
# Mount additional Python packages
- ./custom-python-packages:/home/jovyan/custom-packages:ro
# Mount external datasets for analysis
- ./external-data:/home/jovyan/external-data:ro
# Mount custom DuckDB extensions
- ./custom-duckdb-extensions:/home/jovyan/.duckdb/extensions:ro
# Expose additional ports if needed for custom services
# ports:
# - "8889:8888" # Alternative Jupyter port
# - "8050:8050" # For Dash/Plotly apps
# Example: Enhanced Airflow configuration
airflow-webserver:
environment:
# Custom webserver settings
- AIRFLOW__WEBSERVER__WORKERS=4
- AIRFLOW__WEBSERVER__SECRET_KEY=your-custom-secret-key
# Enable RBAC and custom auth
- AIRFLOW__WEBSERVER__RBAC=True
volumes:
# Mount custom Airflow plugins
- ./custom-airflow-plugins:/opt/airflow/plugins:ro
# Mount custom requirements
- ./custom-requirements.txt:/opt/airflow/requirements.txt:ro
airflow-scheduler:
environment:
# Enhanced scheduler performance
- AIRFLOW__SCHEDULER__MAX_THREADS=8
- AIRFLOW__CORE__PARALLELISM=64
- AIRFLOW__CORE__MAX_ACTIVE_RUNS_PER_DAG=32
volumes:
# Same custom volumes as webserver
- ./custom-airflow-plugins:/opt/airflow/plugins:ro
- ./custom-requirements.txt:/opt/airflow/requirements.txt:ro
# Example: Enhanced Superset configuration with dual analytics
superset:
environment:
# NOTE: SUPERSET_SECRET_KEY is auto-generated - see ./scripts/show-credentials.sh
# Custom secret key (optional override - use strong random string)
# - SUPERSET_SECRET_KEY=your-very-long-random-secret-key-here
# Enhanced performance settings
- SUPERSET_WORKERS=8
- SUPERSET_TIMEOUT=120
- SUPERSET_WEBSERVER_TIMEOUT=120
# Enable additional features
- SUPERSET_FEATURE_FLAGS='{"ENABLE_TEMPLATE_PROCESSING": true, "DASHBOARD_NATIVE_FILTERS": true}'
# Database connections (both DuckDB and PostgreSQL pre-configured)
# - SUPERSET_CONFIG_PATH=/app/superset_config.py
volumes:
# Mount custom Superset configuration
- ./custom-superset-config.py:/app/superset_config.py:ro
# Mount custom themes/assets
- ./custom-superset-assets:/app/superset/static/assets/custom:ro
# Mount additional DuckDB database files
- ./custom-duckdb-files:/app/superset_home/databases:ro
# Enhanced health check
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8088/health"]
interval: 30s
timeout: 15s
retries: 3
start_period: 90s
# Example: Enhanced PostgreSQL configuration for analytics
postgres:
environment:
# Performance tuning for analytics workloads
- POSTGRES_SHARED_BUFFERS=512MB # Increase for larger datasets
- POSTGRES_EFFECTIVE_CACHE_SIZE=4GB # Set to ~75% of available RAM
- POSTGRES_MAINTENANCE_WORK_MEM=256MB # Increase for faster index builds
- POSTGRES_WORK_MEM=32MB # Per-connection memory for sorts/joins
- POSTGRES_CHECKPOINT_COMPLETION_TARGET=0.9
- POSTGRES_WAL_BUFFERS=64MB
- POSTGRES_DEFAULT_STATISTICS_TARGET=100
# Enable connection pooling
- POSTGRES_MAX_CONNECTIONS=200
volumes:
# Mount custom postgres configuration
- ./custom-postgres.conf:/etc/postgresql/postgresql.conf:ro
# Mount initialization scripts for analytics schema
- ./postgres-init-scripts:/docker-entrypoint-initdb.d:ro
# Use external storage for better performance
# - /mnt/fast-storage/postgres:/var/lib/postgresql/data
command: >
postgres
-c shared_buffers=512MB
-c effective_cache_size=4GB
-c maintenance_work_mem=256MB
-c checkpoint_completion_target=0.9
-c wal_buffers=64MB
-c default_statistics_target=100
-c random_page_cost=1.1
-c effective_io_concurrency=200
-c work_mem=32MB
-c max_connections=200
# Example: Enhanced Portainer configuration
portainer:
environment:
# Hide specific labels from view
- PORTAINER_HIDE_LABELS=dev,staging
volumes:
# Mount custom Portainer data location
# - ./portainer-data:/data
# Mount additional Docker endpoints
# - /var/run/docker.sock:/var/run/docker.sock:ro
# Example: Add optional Homer service with custom config
homer:
profiles:
- full # Only start with specific profile
volumes:
# Mount custom Homer configuration
- ./custom-homer-config.yml:/www/assets/config.yml:ro
# Mount custom Homer assets
- ./custom-homer-assets:/www/assets/custom:ro
# Example: Add custom networks
networks:
lakehouse:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/16
# Example: Add external database for Superset metadata
external-postgres:
image: postgres:16
environment:
POSTGRES_DB: superset_meta
POSTGRES_USER: superset
POSTGRES_PASSWORD: secure-password-here
volumes:
- external-superset-db:/var/lib/postgresql/data
networks:
- lakehouse
# Only start if explicitly requested
profiles:
- external-db
# Example: Add Redis for Airflow Celery executor (if needed)
redis:
image: redis:7-alpine
command: redis-server --requirepass redis-password
volumes:
- redis-data:/data
networks:
- lakehouse
profiles:
- celery
# Example: Add monitoring with Grafana
grafana:
image: grafana/grafana:latest
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin123
- GF_USERS_ALLOW_SIGN_UP=false
ports:
- "3000:3000"
volumes:
- grafana-data:/var/lib/grafana
- ./grafana-dashboards:/etc/grafana/provisioning/dashboards:ro
- ./grafana-datasources:/etc/grafana/provisioning/datasources:ro
networks:
- lakehouse
profiles:
- monitoring
# Example: Add Prometheus for metrics collection
prometheus:
image: prom/prometheus:latest
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/etc/prometheus/console_libraries'
- '--web.console.templates=/etc/prometheus/consoles'
- '--web.enable-lifecycle'
ports:
- "9090:9090"
volumes:
- ./prometheus-config.yml:/etc/prometheus/prometheus.yml:ro
- prometheus-data:/prometheus
networks:
- lakehouse
profiles:
- monitoring
volumes:
# Example: External volumes for persistent data
external-superset-db:
driver: local
redis-data:
driver: local
grafana-data:
driver: local
prometheus-data:
driver: local
# Example: Custom volume configurations
# Use external storage for MinIO
# minio-data:
# driver: local
# driver_opts:
# type: none
# o: bind
# device: /mnt/external-storage/minio
# ==============================================================================
# DUCKDB & CREDENTIAL MANAGEMENT EXAMPLES
# ==============================================================================
# Example: Create custom initialization script for DuckDB persistent secrets
# Create a file ./custom-init/setup-duckdb-secrets.sql:
#
# -- Auto-configure DuckDB persistent secrets
# CREATE PERSISTENT SECRET minio_prod (
# TYPE S3,
# KEY_ID 'admin',
# SECRET '${MINIO_ROOT_PASSWORD}',
# ENDPOINT 'minio:9000',
# USE_SSL false,
# URL_STYLE 'path',
# SCOPE 's3://lakehouse'
# );
#
# -- Create additional secrets for external S3 buckets
# CREATE PERSISTENT SECRET aws_s3_prod (
# TYPE S3,
# KEY_ID 'your-aws-access-key',
# SECRET 'your-aws-secret-key',
# REGION 'us-west-2',
# SCOPE 's3://your-prod-bucket'
# );
# Example: Mount custom initialization scripts
# lakehouse-init:
# volumes:
# - ./custom-init:/host/custom-init:ro
# environment:
# - CUSTOM_INIT_SCRIPTS=/host/custom-init
# ==============================================================================
# PRODUCTION DEPLOYMENT EXAMPLES
# ==============================================================================
# Example configurations you can uncomment and customize:
# For production SSL termination with nginx:
# nginx:
# image: nginx:alpine
# ports:
# - "80:80"
# - "443:443"
# volumes:
# - ./nginx.conf:/etc/nginx/nginx.conf:ro
# - ./ssl-certs:/etc/nginx/ssl:ro
# depends_on:
# - superset
# - jupyter
# - airflow-webserver
# networks:
# - lakehouse
# For backup automation:
# backup:
# image: alpine:latest
# command: |
# sh -c "
# apk add --no-cache rsync &&
# while true; do
# rsync -av /data/ /backup/lakehouse-$(date +%Y%m%d)/
# sleep 86400
# done
# "
# volumes:
# - ${LAKEHOUSE_ROOT:-./lakehouse-data}:/data:ro
# - ./backups:/backup
# profiles:
# - backup