dosubot[bot] commented on issue #30183:
URL: https://github.com/apache/superset/issues/30183#issuecomment-2335120172

   <!-- Answer -->
   I found some similar issues and discussions that might help you resolve the 
404 Not Found errors for static assets in Superset when using Docker:
   
   1. **Closed Issue: [GET /ws HTTP/1.1 werkzeug.exceptions.NotFound: 404 Not 
Found](https://github.com/apache/superset/issues/20815)**
      - This issue was resolved by ensuring that the static assets are 
correctly built and copied into the final Docker image 
<sup>[[1]](https://github.com/apache/superset/issues/20815)</sup>.
   
   2. **Closed Issue: [NotFound errors on 
2.0.1rc2](https://github.com/apache/superset/issues/22044)**
      - The suggested solution was to move to `docker-compose` and ensure 
proper setup and configuration 
<sup>[[2]](https://github.com/apache/superset/issues/22044)</sup>.
   
   3. **Closed Issue: [[Errno 99] Cannot assign requested address in 
superset_init for 
docker-compose](https://github.com/apache/superset/issues/11322)**
      - A non-dev Docker compose file was added to help with frontend assets 
<sup>[[3]](https://github.com/apache/superset/issues/11322)</sup>.
   
   To resolve the 404 Not Found errors for static assets, follow these steps:
   
   1. **Verify the build process:**
      Ensure that the `npm run build` command completes without errors and 
generates the necessary static assets.
   
   2. **Check the asset paths:**
      Ensure that the paths to the static assets are correct and that they are 
being copied to the expected location in the final Docker image.
   
   3. **Run the Docker build without skipping the build step:**
      Make sure `DEV_MODE` is set to `false` to ensure the assets are built and 
copied:
      ```sh
      docker build --build-arg DEV_MODE=false -t your-superset-image .
      ```
   
   4. **Configure Nginx correctly:**
      Ensure that your Nginx configuration is set up to serve the static assets 
properly. Here is a sample configuration snippet from `docker/nginx/nginx.conf`:
      ```conf
      server {
          listen 80 default_server;
          server_name  _;
   
          location /ws {
              proxy_pass http://superset_websocket;
              proxy_http_version 1.1;
              proxy_set_header Upgrade $http_upgrade;
              proxy_set_header Connection "Upgrade";
              proxy_set_header Host $host;
          }
   
          location / {
              proxy_pass http://superset_app;
              proxy_set_header    Host                $host;
              proxy_set_header    X-Real-IP           $remote_addr;
              proxy_set_header    X-Forwarded-For     $remote_addr;
              proxy_set_header    X-Forwarded-Host    $host;
              proxy_set_header    X-Forwarded-Proto   $scheme;
              proxy_http_version 1.1;
              port_in_redirect off;
              proxy_connect_timeout 300;
          }
      }
      ```
   
   Additionally, ensure that you follow the steps outlined in the Superset 
Docker documentation for proper setup and configuration:
   
   1. **Prerequisites:**
      - Install [Docker](https://www.docker.com/get-started)
      - Install [Docker Compose](https://docs.docker.com/compose/install/)
   
   2. **Configuration:**
      - The `/app/pythonpath` folder is mounted from `./docker/pythonpath_dev` 
which contains a base configuration 
`./docker/pythonpath_dev/superset_config.py` intended for use with local 
development.
      - For local overrides, copy 
`./docker/pythonpath_dev/superset_config_local.example` to 
`./docker/pythonpath_dev/superset_config_docker.py` and fill in your overrides.
   
   3. **Initializing Database:**
      - The database will initialize itself upon startup via the init container 
(`superset-init`). This may take a minute.
   
   4. **Normal Operation:**
      - To run the container, simply run: `docker compose up`
      - After waiting several minutes for Superset initialization to finish, 
you can open a browser and view `http://localhost:8088`.
   
   By following these steps, you should be able to resolve the 404 Not Found 
errors for static assets in Superset when using Docker 
<sup>[[4]](https://github.com/apache/superset/blob/master/Dockerfile)</sup><sup>[[5]](https://github.com/apache/superset/blob/master/docker/nginx/nginx.conf)</sup><sup>[[6]](https://github.com/apache/superset/blob/master/docker/README.md)</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]

Reply via email to