Harden frontend Docker npm fetch resilience

This commit is contained in:
2026-03-02 14:38:26 -03:00
parent b6d470590e
commit c47fc48533
4 changed files with 44 additions and 1 deletions

View File

@@ -42,6 +42,23 @@ Tail logs:
docker compose logs -f
```
## Frontend Build Network Resilience
The frontend image build supports npm fetch tuning through environment-driven compose build args:
- `NPM_REGISTRY` (default `https://registry.npmjs.org/`)
- `NPM_FETCH_RETRIES` (default `5`)
- `NPM_FETCH_RETRY_MINTIMEOUT` (default `20000`)
- `NPM_FETCH_RETRY_MAXTIMEOUT` (default `120000`)
- `NPM_FETCH_TIMEOUT` (default `300000`)
- `DOCKER_BUILD_NETWORK` (default `default`; set to `host` on Linux hosts when bridge-network npm fetches time out)
If frontend dependency downloads fail with npm `ETIMEDOUT` during `docker compose build`, keep defaults first, then try:
```bash
DOCKER_BUILD_NETWORK=host docker compose build --no-cache frontend
```
## Authentication Model
- Legacy shared build-time frontend token behavior was removed.