#!/bin/sh # TRM directus — image entrypoint (placeholder). # # Real flow (db-init runner → directus schema apply --yes → directus start) # lands in Phase 1 task 1.7. Until then, this script replicates the upstream # Directus image CMD so the container boots normally during tasks 1.4 and 1.5 # (admin UI schema work). # # Upstream CMD (from directus/directus:11.17.4 Dockerfile): # node cli.js bootstrap && pm2-runtime start ecosystem.config.cjs # # bootstrap: idempotent — initialises the DB schema on first run, reads # ADMIN_EMAIL / ADMIN_PASSWORD to create the initial admin user. # pm2-runtime: starts the Directus process under PM2 so the container stays # alive and restarts on crash without an outer supervisor. # # Exit codes are propagated: any non-zero exit causes the container to exit # with that code, which compose reports as an error. set -e node /directus/cli.js bootstrap exec pm2-runtime start /directus/ecosystem.config.cjs