GitHub user dosubot[bot] added a comment to the discussion: Custom docker image build on top of an existing official image
<!-- Answer --> Here's a Dockerfile example to build a custom image on top of the official Superset 5.0.0 image, allowing you to override files in both the superset-frontend and superset folders: ```dockerfile FROM apache/superset:5.0.0 # Copy your custom backend files (Python, configs, etc.) COPY superset/ /app/superset/ # Copy your custom frontend files (JS, CSS, etc.) COPY superset-frontend/ /app/superset-frontend/ # If you changed anything in superset-frontend, rebuild the frontend assets WORKDIR /app/superset-frontend RUN npm ci && npm run build # (Optional) Remove duplicate /app/superset to save space if not needed # RUN rm -rf /app/superset # Return to default workdir WORKDIR /app # Entrypoint and CMD are inherited from the base image ``` - Place your custom files in local superset/ and superset-frontend/ folders relative to your Docker build context. - The `COPY` instructions overwrite the corresponding files in the image. - The `npm ci && npm run build` step ensures your frontend changes are compiled and available to Superset. This is necessary for any JS/CSS changes to take effect [[source]](https://github.com/apache/superset/issues/33875). - Backend changes (Python, configs) are picked up automatically after copying. If you need extra system dependencies, you can add `RUN apt-get update && apt-get install -y ...` before the build steps [[source]](https://github.com/apache/superset/issues/33875). Let me know if you need help with a specific file structure or further customization! <!-- 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/eb9c8ad1-8c0a-4f18-a687-9c5876421d05?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/eb9c8ad1-8c0a-4f18-a687-9c5876421d05?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/eb9c8ad1-8c0a-4f18-a687-9c5876421d05?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/eb9c8ad1-8c0a-4f18-a687-9c5876421d05?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/eb9c8ad1-8c0a-4f18-a687-9c5876421d05?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/eb9c8ad1-8c0a-4f18-a687-9c5876421d05?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/eb9c8ad1-8c0a-4f18-a687-9c5876421d05?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)& nbsp;[](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/35320) GitHub link: https://github.com/apache/superset/discussions/35320#discussioncomment-14538257 ---- 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]
