dosubot[bot] commented on issue #29462: URL: https://github.com/apache/superset/issues/29462#issuecomment-2204976581
<!-- Greeting --> Hey there, @jtcurlin! I'm Dosu, a bot here to help you with bugs, questions, and becoming a contributor. Let's squash those bugs together! 🤖 <!-- Answer --> To prevent the frontend build from running in Docker when setting `BUILD_SUPERSET_FRONTEND_IN_DOCKER` to `false` within the `.env` file, you need to ensure that the Dockerfile and related scripts respect this environment variable. Currently, setting `BUILD_SUPERSET_FRONTEND_IN_DOCKER` to `false` only affects the `docker/docker-frontend.sh` script, which skips the frontend build steps and outputs the message "Skipping frontend build steps - YOU RUN IT MANUALLY ON THE HOST!" <sup>[[1]](https://github.com/apache/superset/blob/master/docker/.env)</sup>. However, the `npm run build` command in the Dockerfile is not conditional on this environment variable. To address this, you can modify the Dockerfile to conditionally run the frontend build based on the `BUILD_SUPERSET_FRONTEND_IN_DOCKER` variable. Here is an example of how you can modify the Dockerfile: ```dockerfile # Dockerfile ARG BUILD_SUPERSET_FRONTEND_IN_DOCKER=true # Other Dockerfile steps... # Conditionally run the frontend build RUN if [ "$BUILD_SUPERSET_FRONTEND_IN_DOCKER" = "true" ]; then npm run build; else echo "Skipping frontend build"; fi ``` This modification ensures that the frontend build only runs if `BUILD_SUPERSET_FRONTEND_IN_DOCKER` is set to `true`. Additionally, if you have less than 16GB of memory, running the frontend build locally can be much faster. You can do this by navigating to the `superset-frontend` directory and running: ```bash npm install npm run dev ``` This will install the necessary dependencies and start the development server for the frontend, allowing you to see changes in real-time <sup>[[1]](https://github.com/apache/superset/blob/master/docker/.env)</sup>. For more details on the recent changes to the Dockerfile that might affect the frontend build process, you can refer to the specific updates such as the Node version update, NPM build command argument, memory management script, and translation files handling <sup>[[2]](https://github.com/apache/superset/blob/master/Dockerfile)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
