rusackas opened a new pull request, #38161:
URL: https://github.com/apache/superset/pull/38161

   ### SUMMARY
   
   Fixes a race condition in the Docker development setup where nginx starts 
before the webpack dev server is ready, causing 404 errors for all static 
assets (`/static/assets/images/superset-logo-horiz.png`, etc.).
   
   **Root Cause:**
   When running `docker compose up`, nginx starts immediately and proxies 
`/static` requests to port 9000. However, the `superset-node` container needs 
time to:
   1. Run `npm install` (can take several minutes)
   2. Start the webpack dev server
   
   During this startup period, all static asset requests fail with 404 errors.
   
   **The Fix:**
   1. Added a health check to `superset-node` that verifies the webpack dev 
server is responding on port 9000
   2. Added `depends_on: superset-node: condition: service_healthy` to nginx so 
it waits for the frontend to be ready
   
   The health check uses Node.js (already in the container) to make HTTP 
requests, with a 60-second start period and up to 30 retries at 10-second 
intervals (5+ minutes total wait time).
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   **Before:** Static assets return 404 during startup, broken UI
   **After:** Nginx waits for webpack dev server to be healthy before starting
   
   ### TESTING INSTRUCTIONS
   
   1. Clean your Docker environment:
      ```bash
      docker compose down -v
      docker builder prune --all --force
      ```
   
   2. Start fresh:
      ```bash
      docker compose up
      ```
   
   3. Watch the logs - you should see:
      - `superset-node` running `npm install` and starting dev server
      - nginx waiting (health check retrying)
      - nginx starting only after `superset-node` is healthy
   
   4. Access http://localhost - static assets should load correctly
   
   ### ADDITIONAL INFORMATION
   
   - [x] Has associated issue: Fixes #30183
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   🤖 Generated with [Claude Code](https://claude.ai/code)


-- 
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