Regalamiunsorriso/local-jsp-docker/README.md

54 lines
No EOL
2 KiB
Markdown

# Local JSP Docker Stack
This stack boots the `www` Tomcat webapp locally, seeds MySQL from the checked-in `pg` dump, overrides environment-sensitive `PARM` rows, and captures outgoing email into files.
The default local model seed is `db/pg-model-seed-trimmed-20260421.sql`.
## Services
- `tomcat-www`: Tomcat 9 on Java 11 serving a runtime copy of `www`
- `mysql`: MySQL 8 with first-boot import of `db/pg-model-seed-trimmed-20260421.sql` by default
- `maildump`: local SMTP sink writing `.eml`, `.txt`, and `.html` payloads to disk
## What Gets Mocked
- `PARM.DOCBASE` points to `/data/docbase/`
- temp, help, and mailer paths are redirected under `/data/docbase/`
- SMTP points to the local `maildump` service
- common external-storage style paths are mapped to local fixture directories from `test_pkl`
## Start
From this folder:
```powershell
docker compose up --build
```
The public site is exposed on `http://localhost:8080`.
Mail output is written under `local-jsp-docker/runtime/maildump/out`.
## First Boot
The first MySQL start imports the file named by `LOCAL_DB_SEED_DUMP`, which defaults to `db/pg-model-seed-trimmed-20260421.sql`.
After the import finishes, the local override script updates `PARM` with local-safe values.
The Tomcat runtime also patches the deployed `WEB-INF/web.xml` so the `instance` context-param is `local-model` instead of `main`. That keeps the startup DB updater servlets from mutating the model database during local boot.
## Restart Workflow
JSP edits are picked up by restarting `tomcat-www`:
```powershell
docker compose restart tomcat-www
```
The Tomcat container copies `www` into a runtime directory on each start, patches the deployed `WEB-INF/web.xml`, and then runs Tomcat.
## Notes
- This stack currently targets the `www` runtime only.
- PHP files in `www` are not executed by this stack.
- If the app still references production-only paths from DB data, add them to `mysql/init/20-local-overrides.sh` and `tomcat/bootstrap-docbase.sh`.