Docker Development Environment#
Superset's Docker Compose setup supports local development and evaluation (not production). Three distinct Compose files target different use cases :
| Compose file | Use case | Key behavior |
|---|---|---|
docker-compose.yml | Interactive development | Mounts local source folders; webpack watches for changes in real time |
docker-compose-non-dev.yml | Immutable local build | Builds images from the current branch; code changes after up are not reflected |
docker-compose-image-tag.yml | Pre-built release | Pulls a versioned image from Docker Hub; local branch has no effect |
Not production-ready. Docker Compose is designed for single-host use. For HA deployments, use Kubernetes.
Services in docker-compose.yml#
The default compose file starts these services:
superset– Flask app server, launched viadocker/docker-bootstrap.sh appsuperset-init– One-shot init container that runsdocker/docker-init.sh: applies DB migrations, creates the admin user, sets up roles, and optionally loads examplessuperset-node– Node container runningdocker/docker-frontend.shfor webpack buildssuperset-worker/superset-worker-beat– Celery workers launched viadocker-bootstrap.sh worker/beatsuperset-websocket– Async websocket server on port 8080redis,db(Postgres 16),nginx– Backing services
All Superset services share a common x-superset-volumes block that mounts ./docker, ./superset, ./superset-frontend, and ./tests into the container , enabling live code reloading.
Frontend Build: superset-node and docker-frontend.sh#
docker/docker-frontend.sh is the entrypoint for the superset-node container. Its behaviour is controlled by two env vars :
BUILD_SUPERSET_FRONTEND_IN_DOCKER=true(default): runsnpm installthennpm run dev-serverinside the container, serving webpack output on port 9000.BUILD_SUPERSET_FRONTEND_IN_DOCKER=false: skips the build entirely — you must runnpm i && npm run devon the host yourself (recommended if you have <16 GB RAM) .NPM_RUN_PRUNE=true: runsnpm run prunebefore install to clear stalenode_modules.
The npm run dev-server script launches webpack-dev-server in development mode, serving on localhost:9000 .
Webpack Proxy Configuration#
superset-frontend/webpack.proxy-config.js proxies all non-asset requests from the webpack dev server back to the Flask backend. The backend URL is resolved from the superset environment variable (injected as http://superset:8088 when running in Docker) or defaults to http://localhost:8088 . HTML responses are intercepted and rewritten via toDevHTML() to replace bundled asset tags with dev-server paths and prefix the page title with [DEV].
Environment Variables#
All services load env from two layered files :
| File | Purpose |
|---|---|
docker/.env | Committed defaults (dev DB passwords, Redis host, Flask debug, etc.) |
docker/.env-local | Local overrides — git-ignored, safe for secrets |
Key variables from docker/.env:
| Variable | Default | Notes |
|---|---|---|
BUILD_SUPERSET_FRONTEND_IN_DOCKER | true | Set to false to run webpack on host |
SUPERSET_LOAD_EXAMPLES | yes | Loads example dashboards/datasets on init |
FLASK_DEBUG | true | Enables Flask auto-reload |
SUPERSET_SECRET_KEY | TEST_NON_DEV_SECRET | Must be changed for any real deployment |
DATABASE_HOST / REDIS_HOST | db / redis | Docker Compose service names |
SUPERSET_ENV | development |
Python-level overrides can be placed in docker/pythonpath_dev/superset_config_docker.py (git-ignored); the base config at docker/pythonpath_dev/superset_config.py auto-imports it .
Pre-built Release Mode (docker-compose-image-tag.yml)#
The image is pulled from Docker Hub via the TAG env var (default: latest-dev). Use a -dev-suffixed tag (e.g. 5.0.0-dev) because dev builds include psycopg2-binary needed to connect to the bundled Postgres container .
Key File Index#
| Path | Role |
|---|---|
docker-compose.yml | Interactive dev stack |
docker-compose-non-dev.yml | Immutable local build stack |
docker-compose-image-tag.yml | Pre-built release stack |
docker/.env | Default env vars |
docker/docker-bootstrap.sh | App/worker startup entrypoint |
docker/docker-init.sh | One-time DB init + admin user creation |
docker/docker-frontend.sh | Frontend build orchestration |
superset-frontend/webpack.proxy-config.js | Webpack → Flask proxy + HTML rewriting |
docs/docs/installation/docker-compose.mdx | Official installation guide |