Switch frontend container to production-aware runtime mode
This commit is contained in:
17
frontend/docker-entrypoint.sh
Normal file
17
frontend/docker-entrypoint.sh
Normal 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"
|
||||
Reference in New Issue
Block a user