Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

refactor(service): improve superset

peaklabs-dev7f54fa4ef440
diff --git a/templates/compose/superset-unofficial-with-postgresql.yaml b/templates/compose/superset-with-postgresql.yaml
similarity index 79%
rename from templates/compose/superset-unofficial-with-postgresql.yaml
rename to templates/compose/superset-with-postgresql.yaml
index ae1680ac91..d87c159ea1 100644
--- a/templates/compose/superset-unofficial-with-postgresql.yaml
+++ b/templates/compose/superset-with-postgresql.yaml
@@ -1,24 +1,21 @@
# documentation: https://github.com/amancevice/docker-superset
-# slogan: Modern data exploration and visualization platform (unofficial docker image)
+# slogan: Modern data exploration and visualization platform (unofficial community docker image)
# tags: analytics,bi,dashboard,database,sql,unofficial
# logo: svgs/superset.svg
# port: 8088
services:
superset:
- image: amancevice/superset
- restart: always
- depends_on:
- - superset_postgres
- - superset_redis
+ image: amancevice/superset:latest
environment:
- SERVICE_FQDN_SUPERSET_8088
- SECRET_KEY=${SERVICE_BASE64_64_SUPERSETSECRETKEY}
- MAPBOX_API_KEY=${MAPBOX_API_KEY}
- POSTGRES_USER=${SERVICE_USER_POSTGRES}
- POSTGRES_PASSWORD=${SERVICE_PASSWORD_POSTGRES}
- - POSTGRES_DB=superset
+ - POSTGRES_DB=${POSTGRES_DB:-superset-db}
- REDIS_PASSWORD=${SERVICE_PASSWORD_REDIS}
+ - PYTHONPATH=/etc/superset
volumes:
- type: bind
source: ./superset/superset_config.py
@@ -33,41 +30,44 @@ services:
SECRET_KEY = os.getenv("SECRET_KEY")
MAPBOX_API_KEY = os.getenv("MAPBOX_API_KEY", "")
- COOLIFY_RESOURCE_UUID = os.getenv('COOLIFY_RESOURCE_UUID')
CACHE_CONFIG = {
"CACHE_TYPE": "RedisCache",
"CACHE_DEFAULT_TIMEOUT": 300,
"CACHE_KEY_PREFIX": "superset_",
- "CACHE_REDIS_HOST": "superset_redis",
+ "CACHE_REDIS_HOST": "redis",
"CACHE_REDIS_PORT": 6379,
"CACHE_REDIS_DB": 1,
- "CACHE_REDIS_URL": f"redis://:{os.getenv('REDIS_PASSWORD')}@superset_redis-{COOLIFY_RESOURCE_UUID}:6379/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_TRACK_MODIFICATIONS = True
- SQLALCHEMY_DATABASE_URI = f"postgresql+psycopg2://{os.getenv('POSTGRES_USER')}:{os.getenv('POSTGRES_PASSWORD')}@superset_postgres-{COOLIFY_RESOURCE_UUID}:5432/{os.getenv('POSTGRES_DB')}"
+ SQLALCHEMY_DATABASE_URI = f"postgresql+psycopg2://{os.getenv('POSTGRES_USER')}:{os.getenv('POSTGRES_PASSWORD')}@postgres:5432/{os.getenv('POSTGRES_DB')}"
# Uncomment if you want to load example data (using "superset load_examples") at the
# same location as your metadata postgresql instance. Otherwise, the default sqlite
# will be used, which will not persist in volume when restarting superset by default.
#SQLALCHEMY_EXAMPLES_URI = SQLALCHEMY_DATABASE_URI
+ depends_on:
+ postgres:
+ condition: service_healthy
+ redis:
+ condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://127.0.0.1:8088/health"]
interval: 5s
timeout: 20s
retries: 10
- superset_postgres:
- image: postgres
- restart: always
+ postgres:
+ image: postgres:17-alpine
environment:
- POSTGRES_USER=${SERVICE_USER_POSTGRES}
- POSTGRES_PASSWORD=${SERVICE_PASSWORD_POSTGRES}
- - POSTGRES_DB=superset
+ - POSTGRES_DB=${POSTGRES_DB:-superset-db}
volumes:
- superset_postgres_data:/var/lib/postgresql/data
healthcheck:
@@ -76,9 +76,8 @@ services:
timeout: 20s
retries: 10
- superset_redis:
- image: redis
- restart: always
+ redis:
+ image: redis:8-alpine
volumes:
- superset_redis_data:/data
command: redis-server --requirepass ${SERVICE_PASSWORD_REDIS}
@@ -87,7 +86,3 @@ services:
interval: 5s
timeout: 20s
retries: 10
-
-volumes:
- superset_postgres_data:
- superset_redis_data: