GitHub user dosubot[bot] added a comment to the discussion: How to create a
visualization plugin in superset 6.0.0 using docker
<!-- Answer -->
Here’s a concrete Dockerfile example for deploying a Superset visualization
plugin using local files (not published to npm):
```dockerfile
FROM apache/superset:latest
USER root
# Copy your local superset-frontend directory (with your plugin and
registration in MainPreset.js)
COPY superset-frontend/ /app/superset-frontend/
# Rebuild frontend assets inside the container
RUN cd /app/superset-frontend && \
npm ci && npm run build && \
cp -r /app/superset-frontend/build/* /app/superset/static/assets/
USER superset
```
**Key steps:**
- Place your local plugin files inside your `superset-frontend` directory and
register the plugin in `MainPreset.js` before building.
- Make sure your `superset-frontend` directory contains all required files from
the official release (especially the `src` folder), or the build will fail with
missing file errors.
- Superset 6.0.0+ requires Node.js 20.x for frontend builds—using older Node
versions will cause build failures[^1].
- After building your image (`docker build -t custom-superset .`), run it with
`docker run -d -p 8088:8088 custom-superset` to deploy your instance with the
plugin included.
**Troubleshooting tips:**
- If you only want to override a few frontend files (like your plugin), copy
just those files instead of the whole directory to avoid build errors[^2].
- If you see npm/network errors, try configuring npm to use a reliable registry
mirror: `npm config set registry http://mirrors.ustc.edu.cn/`[^3].
For advanced setups, you can use a multi-stage Docker build to keep the final
image smaller by building frontend assets in a node:20 stage and copying only
the built assets into the final image[^4].
[^1]: [Node.js version requirement and build
errors](https://github.com/apache/superset/issues/35607#issuecomment-3393068000)
[^2]: [Dockerfile example and file copying
advice](https://github.com/apache/superset/discussions/35320#discussioncomment-14538331)
[^3]: [npm registry
troubleshooting](https://github.com/apache/superset/issues/35607#issuecomment-3393068000)
[^4]: [Multi-stage build
example](https://github.com/apache/superset/discussions/31640#discussioncomment-11687869)
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
---
<sup>How did I do?
[Good](https://app.dosu.dev/response-feedback/3da24d94-0c90-4513-8c34-faf35754154f?feedback_type=great_response)
|
[Irrelevant](https://app.dosu.dev/response-feedback/3da24d94-0c90-4513-8c34-faf35754154f?feedback_type=irrelevant_answer)
|
[Incorrect](https://app.dosu.dev/response-feedback/3da24d94-0c90-4513-8c34-faf35754154f?feedback_type=incorrect_sources)
|
[Verbose](https://app.dosu.dev/response-feedback/3da24d94-0c90-4513-8c34-faf35754154f?feedback_type=too_verbose)
|
[Hallucination](https://app.dosu.dev/response-feedback/3da24d94-0c90-4513-8c34-faf35754154f?feedback_type=hallucination)
| [Report
🐛](https://app.dosu.dev/response-feedback/3da24d94-0c90-4513-8c34-faf35754154f?feedback_type=bug_report)
|
[Other](https://app.dosu.dev/response-feedback/3da24d94-0c90-4513-8c34-faf35754154f?feedback_type=other)</sup>
[](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github) [](https://cursor.com/link/prompt?text=Here%E2%80%99s%20a%20concrete%20Dockerfile%20example%20for%20deploying%20a%20Superset%20visualization%20plugin%20using%20local%20files%20%28not%20published%20to%20npm%29%3A%0A%0A%60%60%60dockerfile%0AFROM%20apache/superset%3Alatest%0AUSER%20root%0A%0A%23%20Copy%20your%20local%20superset-frontend%20directory%20%28with%20your%20plugin%20and%20registration%20in%20MainPreset.js%29%0ACOPY%20superset-frontend/%20/app/superset-frontend/%0A%0A%23%20Rebuild%20frontend%20assets%20inside%20the%20container%0ARUN%20cd%20/app/superset-frontend%20%26%26%20%5C%0A%20%20%20%20npm%20ci%20%26%26%20npm%20run%20build%20%26%26%20%5C%0A%20%20%20%20cp%20-r%20/app/superset-frontend/build/%2A%20/app/superset/static/assets/%0A%0AUSER%20superset%0A%60%60%60%0A%0A%2A%2AKey%20steps
%3A%2A%2A%0A-%20Place%20your%20local%20plugin%20files%20inside%20your%20%60superset-frontend%60%20directory%20and%20register%20the%20plugin%20in%20%60MainPreset.js%60%20before%20building.%0A-%20Make%20sure%20your%20%60superset-frontend%60%20directory%20contains%20all%20required%20files%20from%20the%20official%20release%20%28especially%20the%20%60src%60%20folder%29%2C%20or%20the%20build%20will%20fail%20with%20missing%20file%20errors.%0A-%20Superset%206.0.0%2B%20requires%20Node.js%2020.x%20for%20frontend%20builds%E2%80%94using%20older%20Node%20versions%20will%20cause%20build%20failures%5B%5E1%5D.%0A-%20After%20building%20your%20image%20%28%60docker%20build%20-t%20custom-superset%20.%60%29%2C%20run%20it%20with%20%60docker%20run%20-d%20-p%208088%3A8088%20custom-superset%60%20to%20deploy%20your%20instance%20with%20the%20plugin%20included.%0A%0A%2A%2ATroubleshooting%20tips%3A%2A%2A%0A-%20If%20you%20only%20want%20to%20override%20a%20few%20frontend%20files%20%28like%20your%20plugin%29%2C%20
copy%20just%20those%20files%20instead%20of%20the%20whole%20directory%20to%20avoid%20build%20errors%5B%5E2%5D.%0A-%20If%20you%20see%20npm/network%20errors%2C%20try%20configuring%20npm%20to%20use%20a%20reliable%20registry%20mirror%3A%20%60npm%20config%20set%20registry%20http%3A//mirrors.ustc.edu.cn/%60%5B%5E3%5D.%0A%0AFor%20advanced%20setups%2C%20you%20can%20use%20a%20multi-stage%20Docker%20build%20to%20keep%20the%20final%20image%20smaller%20by%20building%20frontend%20assets%20in%20a%20node%3A20%20stage%20and%20copying%20only%20the%20built%20assets%20into%20the%20final%20image%5B%5E4%5D.%0A%0A%5B%5E1%5D%3A%20%5BNode.js%20version%20requirement%20and%20build%20errors%5D%28https%3A//github.com/apache/superset/issues/35607%23issuecomment-3393068000%29%0A%5B%5E2%5D%3A%20%5BDockerfile%20example%20and%20file%20copying%20advice%5D%28https%3A//github.com/apache/superset/discussions/35320%23discussioncomment-14538331%29%0A%5B%5E3%5D%3A%20%5Bnpm%20registry%20troubleshooting%5D%28https%3A//github
.com/apache/superset/issues/35607%23issuecomment-3393068000%29%0A%5B%5E4%5D%3A%20%5BMulti-stage%20build%20example%5D%28https%3A//github.com/apache/superset/discussions/31640%23discussioncomment-11687869%29) [](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/discussions/37031)
GitHub link:
https://github.com/apache/superset/discussions/37031#discussioncomment-15464335
----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]