refactor(template): use dokploy mount volume for superset_config.py

This commit is contained in:
Khiet Tam Nguyen
2025-01-21 23:14:28 +11:00
parent 444121f8d8
commit 1a44a0ea5a
2 changed files with 31 additions and 29 deletions
@@ -1,32 +1,6 @@
# Note: this is an UNOFFICIAL production docker image build for Superset:
# - https://github.com/amancevice/docker-superset
#
# Before deploying, you must mount your `superset_config.py` file to
# the superset container. An example config is:
#
# ```python
# import os
#
# SECRET_KEY = os.getenv("SECRET_KEY")
# MAPBOX_API_KEY = os.getenv("MAPBOX_API_KEY", "")
#
# CACHE_CONFIG = {
# "CACHE_TYPE": "RedisCache",
# "CACHE_DEFAULT_TIMEOUT": 300,
# "CACHE_KEY_PREFIX": "superset_",
# "CACHE_REDIS_HOST": "redis",
# "CACHE_REDIS_PORT": 6379,
# "CACHE_REDIS_DB": 1,
# "CACHE_REDIS_URL": f"redis://:{os.getenv('REDIS_PASSWORD')}@redis:6379/1",
# }
#
# FILTER_STATE_CACHE_CONFIG = {**CACHE_CONFIG, "CACHE_KEY_PREFIX": "superset_filter_"}
# EXPLORE_FORM_DATA_CACHE_CONFIG = {**CACHE_CONFIG, "CACHE_KEY_PREFIX": "superset_explore_form_"}
#
# SQLALCHEMY_DATABASE_URI = f"postgresql+psycopg2://{os.getenv('POSTGRES_USER')}:{os.getenv('POSTGRES_PASSWORD')}@db:5432/{os.getenv('POSTGRES_DB')}"
# SQLALCHEMY_TRACK_MODIFICATIONS = True
# ```
#
# After deploying this image, you will need to run one of the two
# commands below in a terminal within the superset container:
# $ superset-demo # Initialise database + load demo charts/datasets
@@ -49,9 +23,8 @@ services:
POSTGRES_DB: ${POSTGRES_DB}
REDIS_PASSWORD: ${REDIS_PASSWORD}
volumes:
# NOTE: ensure `/opt/superset/superset_config.py` exists on your
# host machine (or change the path as appropriate)
- /opt/superset/superset_config.py:/etc/superset/superset_config.py
# Note: superset_config.py can be edited in Dokploy's UI Volume Mount
- ../files/superset/superset_config.py:/etc/superset/superset_config.py
db:
image: postgres