Skip to content

feat(demo): add Scriptor 2.0 Docker demo stack#41

Merged
bigin merged 1 commit into
masterfrom
feat/demo-image
May 13, 2026
Merged

feat(demo): add Scriptor 2.0 Docker demo stack#41
bigin merged 1 commit into
masterfrom
feat/demo-image

Conversation

@bigin
Copy link
Copy Markdown
Owner

@bigin bigin commented May 13, 2026

Adds a one-command Docker stack to try Scriptor 2.0 without installing PHP, Composer, or SQLite locally:

docker compose up -d --build

…brings Scriptor up on http://localhost:8080 with a single admin user (admin / scriptor) and one example page seeded on first start.

Stack shape (matches the iManager deployment guide):

  • scriptor service — php:8.3-fpm-alpine with the iManager extensions (pdo_sqlite, mbstring, gd, dom, zip, opcache), production-shaped opcache (with timestamp validation on so demo restarts pick up code changes), Composer install of bigins/scriptor + bigins/imanager.
  • web service — nginx:alpine fronting it; standard front-controller routing with /data/uploads-2.0/ served directly and the rest of data/ blocked at the URL layer.
  • Both services mount a shared named volume scriptor-app at /var/www/scriptor; web mounts it read-only.
  • docker compose down -v resets the demo to factory state.

Composer install in the image overrides composer.json's path-repo (../imanager) with a VCS repo pointing at the public iManager GitHub repo, so the demo build doesn't need a sibling iManager checkout.

Seed (docker/seed-demo.php) is idempotent. It runs on first start only — if a pages category already exists it exits cleanly. It creates:

  • Pages category + 7 fields (slug, parent, pagetype, menu_title, content, template, images).
  • Users category + 3 fields (role, email, password).
  • Admin user — admin / scriptor, role=admin. Password is passed as plaintext to ItemRepository::save() so the PasswordFieldType does the bcrypt hashing.
  • One Hello-world example page that explains what's been seeded.

Schema migrations are reapplied on every container start (cheap no-op when already current). The library's DefaultBootstrap would auto-migrate on first PDO resolve anyway; the explicit step in the entrypoint gives clearer log output and survives a future entrypoint that doesn't immediately open a connection.

Files:

  • docker/Dockerfile (74 lines)
  • docker/nginx.conf (75 lines)
  • docker/entrypoint.sh (43 lines)
  • docker/seed-demo.php (138 lines, idempotent seed)
  • docker-compose.yml (45 lines)
  • docs/demo.md (149 lines — quickstart + what-the-seed-
    creates + explorations + reset + when-
    NOT-to-use)
  • README.md (+ a "Try it in Docker" subsection
    pointing at docs/demo.md)

This rounds out the Phase 16 deliverables on the Scriptor side; the library-side docs (API ref, cookbooks, deployment guide, migration guide) all landed earlier.

Adds a one-command Docker stack to try Scriptor 2.0 without installing
PHP, Composer, or SQLite locally:

    docker compose up -d --build

…brings Scriptor up on http://localhost:8080 with a single admin user
(admin / scriptor) and one example page seeded on first start.

Stack shape (matches the iManager deployment guide):
- `scriptor` service — php:8.3-fpm-alpine with the iManager extensions
  (pdo_sqlite, mbstring, gd, dom, zip, opcache), production-shaped
  opcache (with timestamp validation on so demo restarts pick up code
  changes), Composer install of bigins/scriptor + bigins/imanager.
- `web` service — nginx:alpine fronting it; standard front-controller
  routing with /data/uploads-2.0/ served directly and the rest of
  data/ blocked at the URL layer.
- Both services mount a shared named volume `scriptor-app` at
  /var/www/scriptor; web mounts it read-only.
- `docker compose down -v` resets the demo to factory state.

Composer install in the image overrides composer.json's path-repo
(`../imanager`) with a VCS repo pointing at the public iManager
GitHub repo, so the demo build doesn't need a sibling iManager
checkout.

Seed (docker/seed-demo.php) is idempotent. It runs on first start
only — if a `pages` category already exists it exits cleanly. It
creates:
- Pages category + 7 fields (slug, parent, pagetype, menu_title,
  content, template, images).
- Users category + 3 fields (role, email, password).
- Admin user — `admin` / `scriptor`, role=admin. Password is passed
  as plaintext to ItemRepository::save() so the PasswordFieldType
  does the bcrypt hashing.
- One Hello-world example page that explains what's been seeded.

Schema migrations are reapplied on every container start (cheap
no-op when already current). The library's `DefaultBootstrap` would
auto-migrate on first PDO resolve anyway; the explicit step in the
entrypoint gives clearer log output and survives a future entrypoint
that doesn't immediately open a connection.

Files:
- docker/Dockerfile          (74 lines)
- docker/nginx.conf          (75 lines)
- docker/entrypoint.sh       (43 lines)
- docker/seed-demo.php       (138 lines, idempotent seed)
- docker-compose.yml         (45 lines)
- docs/demo.md               (149 lines — quickstart + what-the-seed-
                              creates + explorations + reset + when-
                              NOT-to-use)
- README.md                  (+ a "Try it in Docker" subsection
                              pointing at docs/demo.md)

This rounds out the Phase 16 deliverables on the Scriptor side; the
library-side docs (API ref, cookbooks, deployment guide, migration
guide) all landed earlier.
@bigin bigin merged commit f9a1c68 into master May 13, 2026
@bigin bigin deleted the feat/demo-image branch May 13, 2026 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant