add files infra docker service for data platform
This commit is contained in:
20
06-analytics/README.md
Normal file
20
06-analytics/README.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# 06-analytics: Apache Superset BI
|
||||
|
||||
## Start
|
||||
```bash
|
||||
# Create superset database first
|
||||
docker exec postgres psql -U postgres -c "CREATE DATABASE superset;"
|
||||
|
||||
# Start superset
|
||||
docker compose --env-file ../.env.global up -d
|
||||
```
|
||||
|
||||
## Access
|
||||
Internal - configure Nginx Proxy Manager to expose at `/superset`
|
||||
|
||||
## Default Login
|
||||
- Username: see SUPERSET_ADMIN_USERNAME in .env.global
|
||||
- Password: see SUPERSET_ADMIN_PASSWORD in .env.global
|
||||
|
||||
## Keycloak Integration
|
||||
Configure OAuth in superset_config.py after Keycloak setup
|
||||
31
06-analytics/docker-compose.yml
Normal file
31
06-analytics/docker-compose.yml
Normal file
@@ -0,0 +1,31 @@
|
||||
services:
|
||||
superset:
|
||||
image: apache/superset:latest
|
||||
container_name: superset
|
||||
environment:
|
||||
- SUPERSET_SECRET_KEY=${SUPERSET_SECRET_KEY}
|
||||
- DATABASE_DIALECT=postgresql
|
||||
- DATABASE_HOST=postgres
|
||||
- DATABASE_PORT=5432
|
||||
- DATABASE_DB=superset
|
||||
- DATABASE_USER=${DB_USER}
|
||||
- DATABASE_PASSWORD=${DB_PASSWORD}
|
||||
- SUPERSET_LOAD_EXAMPLES=no
|
||||
- TZ=${TZ:-Asia/Bangkok}
|
||||
volumes:
|
||||
- ./data/superset_home:/app/superset_home
|
||||
- ./superset_config.py:/app/pythonpath/superset_config.py
|
||||
networks:
|
||||
- shared_data_network
|
||||
restart: unless-stopped
|
||||
command: >
|
||||
sh -c "
|
||||
superset db upgrade &&
|
||||
superset fab create-admin --username ${SUPERSET_ADMIN_USERNAME} --firstname Admin --lastname User --email admin@sriphat.local --password ${SUPERSET_ADMIN_PASSWORD} || true &&
|
||||
superset init &&
|
||||
gunicorn --bind 0.0.0.0:8088 --workers 4 --timeout 120 --limit-request-line 0 --limit-request-field_size 0 'superset.app:create_app()'
|
||||
"
|
||||
|
||||
networks:
|
||||
shared_data_network:
|
||||
external: true
|
||||
10
06-analytics/superset_config.py
Normal file
10
06-analytics/superset_config.py
Normal file
@@ -0,0 +1,10 @@
|
||||
import os
|
||||
|
||||
SECRET_KEY = os.environ.get('SUPERSET_SECRET_KEY')
|
||||
SQLALCHEMY_DATABASE_URI = f"postgresql://{os.environ.get('DATABASE_USER')}:{os.environ.get('DATABASE_PASSWORD')}@{os.environ.get('DATABASE_HOST')}:{os.environ.get('DATABASE_PORT')}/{os.environ.get('DATABASE_DB')}"
|
||||
|
||||
ENABLE_PROXY_FIX = True
|
||||
PUBLIC_ROLE_LIKE = "Gamma"
|
||||
|
||||
WTF_CSRF_ENABLED = True
|
||||
WTF_CSRF_TIME_LIMIT = None
|
||||
Reference in New Issue
Block a user