add superset airbyte setup and merge md file
This commit is contained in:
15
06-analytics/Dockerfile
Normal file
15
06-analytics/Dockerfile
Normal file
@@ -0,0 +1,15 @@
|
||||
FROM apache/superset:latest
|
||||
|
||||
# เปลี่ยนเป็น root เพื่อติดตั้ง package
|
||||
USER root
|
||||
|
||||
# ติดตั้ง PostgreSQL driver
|
||||
ENV PATH="/app/.venv/bin:$PATH"
|
||||
|
||||
RUN python -m ensurepip --upgrade && \
|
||||
/app/.venv/bin/python -m pip install --upgrade pip setuptools wheel
|
||||
|
||||
RUN /app/.venv/bin/pip install --no-cache-dir psycopg2-binary
|
||||
|
||||
# กลับมาใช้ user superset เพื่อความปลอดภัย
|
||||
USER superset
|
||||
@@ -1,9 +1,12 @@
|
||||
services:
|
||||
superset:
|
||||
image: apache/superset:latest
|
||||
#image: apache/superset:latest
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: superset
|
||||
env_file:
|
||||
- ../.env.global
|
||||
- ../.env
|
||||
environment:
|
||||
- SUPERSET_SECRET_KEY=${SUPERSET_SECRET_KEY}
|
||||
- DATABASE_DIALECT=postgresql
|
||||
@@ -14,6 +17,10 @@ services:
|
||||
- DATABASE_PASSWORD=${DB_PASSWORD}
|
||||
- SUPERSET_LOAD_EXAMPLES=no
|
||||
- TZ=${TZ:-Asia/Bangkok}
|
||||
- SUPERSET_BIND_ADDRESS=0.0.0.0
|
||||
- SUPERSET_PORT=8088
|
||||
ports:
|
||||
- "8088:8088"
|
||||
volumes:
|
||||
- ./data/superset_home:/app/superset_home
|
||||
- ./superset_config.py:/app/pythonpath/superset_config.py
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
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')}"
|
||||
SQLALCHEMY_DATABASE_URI = f"postgresql+psycopg2://{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"
|
||||
|
||||
Reference in New Issue
Block a user