Files
NextChair/docker/entrypoint.sh
T
Stefan Lazic b219fb4519
CI / ci (push) Canceled after 0s
initial NextChair Manager.
Key additions:
* Separate platform Manager stack: [stacks/manager/compose.yaml]
* Dedicated manager authentication with signed sessions.
* Business overview dashboard.
* Add Business workflow with slug suggestions and deployment progress.
* Business detail page with start, stop, restart, update, logs, Dockge, and conservative removal actions.
* Explicit management API endpoints under [src/app/api/manager]
* Shared provisioning service layer in [provisioning.service.ts]
* CLI and UI now use the same [create-business.sh] provisioning logic.
* Registry metadata, database status, container health, and media usage reporting.
* Manager-only entrypoint mode that does not require a business database.
* Updated deployment documentation with Manager setup and Caddy routing.
Validation passed:
* Infra, Caddy, Manager, and generated business Compose configurations.
* Shell syntax checks.
* Registry generation with registry image tags.
* git diff --check.
2026-09-04 20:54:58 +01:00

32 lines
1.5 KiB
Bash

#!/bin/sh
# Entrypoint for the `next-chair` app container — see docker-compose.local.yaml.
# `migrate deploy` (never `migrate reset`) is safe to run on every
# container start: it only applies migrations not yet recorded in
# `_prisma_migrations`, so a restart with an already-up-to-date schema is
# a fast no-op, never destructive. It intentionally does NOT seed —
# development fixtures are a separate, explicit opt-in service (see
# `next-chair-seed` in docker-compose.local.yaml and the brief's own
# "production installation versus development seed" distinction); a
# fresh container is left empty and shows the installation wizard.
set -e
if [ "${MANAGER_MODE:-false}" = "true" ]; then
echo "[entrypoint] Starting in NextChair Manager mode; skipping business database bootstrap."
else
echo "[entrypoint] Applying database migrations..."
npx prisma migrate deploy
# Optional — only provisions/syncs a Super Administrator when
# SUPER_ADMIN_EMAIL is set (see scripts/ensure-super-admin.ts).
echo "[entrypoint] Syncing Super Administrator..."
npx tsx scripts/ensure-super-admin.ts
fi
echo "[entrypoint] Starting application..."
# `exec` + calling the `next` binary directly (not `npm run start`) so
# the Next.js server process itself receives SIGTERM directly from
# Docker on `docker stop` / `docker compose down` — routing through npm
# as an intermediary process can swallow the signal and force a slower
# SIGKILL after Compose's stop-grace-period instead of a clean shutdown.
exec node_modules/.bin/next start -p "${PORT:-3000}"