Update dta_webapp webroot to realpath.app paths #12

Closed
opened 2026-08-06 08:40:35 -07:00 by westfarn · 1 comment
Owner

Summary

Update dta_webapp static document-root pattern from ditchtheagent paths to RealPath host-shaped paths so server-infra deploy + web-static nginx match dta_webapp#48 / PR #49.

Change

In inventory/group_vars/all.yml for dta_webapp:

Path
Old /var/www/{env}.app.ditchtheagent/html
New /var/www/{env}.realpath.app/html

Expands to:

  • beta → /var/www/beta.realpath.app/html
  • prod → /var/www/prod.realpath.app/html

Also update docs (IMPLEMENTATION.md) that still reference the old paths.

Why

roles/app-deploy/tasks/node_static.yml creates _webroot from webroot_pattern, then runs npm run build:<env>. roles/web-static nginx root uses the same pattern. If this stays on *.app.ditchtheagent while the webapp writes to *.realpath.app, deploys land in a dir nginx does not serve.

Coordination

  • dta_webapp build:beta / build:prod must write to the same paths (prod must be prod.realpath.app, not bare realpath.app, to fit {env}).
  • Edge TLS / public server_name for realpath.app is outside this catalog entry (web-static uses server_name _;).
  • dta_service secrets/CORS already handled separately.

Acceptance

  • webroot_pattern updated
  • Docs updated
  • After merge + redeploy, beta/prod builds appear under /var/www/{beta,prod}.realpath.app/html and web-static serves them
## Summary Update `dta_webapp` static document-root pattern from `ditchtheagent` paths to RealPath host-shaped paths so server-infra deploy + web-static nginx match [dta_webapp#48](https://git.aimloperations.com/Ditch_The_Agent/dta_webapp/issues/48) / [PR #49](https://git.aimloperations.com/Ditch_The_Agent/dta_webapp/pulls/49). ## Change In `inventory/group_vars/all.yml` for `dta_webapp`: | | Path | |---|---| | **Old** | `/var/www/{env}.app.ditchtheagent/html` | | **New** | `/var/www/{env}.realpath.app/html` | Expands to: - beta → `/var/www/beta.realpath.app/html` - prod → `/var/www/prod.realpath.app/html` Also update docs (`IMPLEMENTATION.md`) that still reference the old paths. ## Why `roles/app-deploy/tasks/node_static.yml` creates `_webroot` from `webroot_pattern`, then runs `npm run build:<env>`. `roles/web-static` nginx `root` uses the same pattern. If this stays on `*.app.ditchtheagent` while the webapp writes to `*.realpath.app`, deploys land in a dir nginx does not serve. ## Coordination - dta_webapp `build:beta` / `build:prod` must write to the same paths (prod must be `prod.realpath.app`, not bare `realpath.app`, to fit `{env}`). - Edge TLS / public `server_name` for `realpath.app` is outside this catalog entry (web-static uses `server_name _;`). - dta_service secrets/CORS already handled separately. ## Acceptance - [ ] `webroot_pattern` updated - [ ] Docs updated - [ ] After merge + redeploy, beta/prod builds appear under `/var/www/{beta,prod}.realpath.app/html` and web-static serves them
Author
Owner

Follow-up on this PR: yes, port-based cleanup is possible and now in the branch.

roles/web-static before docker compose up:

  1. For each host_apps static port → docker ps -q --filter publish=<port>
  2. docker rm -f those container IDs (includes current web-static if running)
  3. compose up -d --force-recreate when anything was removed

Ports stay 8080/8081/etc.; this only clears whoever is holding them so the managed nginx can bind.

Follow-up on this PR: **yes, port-based cleanup is possible** and now in the branch. `roles/web-static` before `docker compose up`: 1. For each `host_apps` static port → `docker ps -q --filter publish=<port>` 2. `docker rm -f` those container IDs (includes current web-static if running) 3. `compose up -d --force-recreate` when anything was removed Ports stay 8080/8081/etc.; this only clears whoever is holding them so the managed nginx can bind.
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ai_ml_operations/server-infra#12