Switch frontend container to production-aware runtime mode

This commit is contained in:
2026-03-02 15:41:39 -03:00
parent 0acce2e260
commit b5b74845f2
5 changed files with 30 additions and 1 deletions

View File

@@ -0,0 +1,17 @@
#!/bin/sh
# Frontend runtime entrypoint.
# Uses APP_ENV to select development or production Vite startup mode.
set -eu
APP_ENV_VALUE="${APP_ENV:-development}"
HOST_VALUE="${FRONTEND_HOST:-0.0.0.0}"
PORT_VALUE="${FRONTEND_PORT:-5173}"
if [ "$APP_ENV_VALUE" = "production" ]; then
npm run build
exec npm run preview -- --host "$HOST_VALUE" --port "$PORT_VALUE"
fi
exec npm run dev -- --host "$HOST_VALUE" --port "$PORT_VALUE"