21 lines
694 B
Bash
21 lines
694 B
Bash
#!/bin/sh
|
|
# Frontend entrypoint (dev + prod).
|
|
# Fail closed: unset means the production preview server; dev sets
|
|
# FRONTEND_MODE=dev in .env (see .devcontainer/setup.sh).
|
|
set -e
|
|
|
|
cd /srv/kirche-einfach/frontend
|
|
|
|
# node_modules lives in the repo bind-mount (no named volume by design):
|
|
# install on first start after a fresh checkout (dev and prod).
|
|
if [ ! -x "node_modules/.bin/vite" ]; then
|
|
gosu node npm ci
|
|
fi
|
|
|
|
if [ "${FRONTEND_MODE:-preview}" = "dev" ]; then
|
|
exec gosu node npm run dev -- --host 0.0.0.0 --port 3000
|
|
else
|
|
# Build as node so dist/ stays editor-writable; preview serves as node.
|
|
gosu node npm run build
|
|
exec gosu node npm run preview -- --host 0.0.0.0 --port 3000
|
|
fi
|