Run frontend in production mode during compose startup

This commit is contained in:
Ruslan Bakiev
2026-02-20 00:54:38 +07:00
parent 8895810aea
commit d2d978c216

View File

@@ -3,8 +3,7 @@ set -euo pipefail
cd "$(dirname "$0")/.."
# Prevent path leakage between host Nuxt build cache and Docker runtime.
# If any cache contains absolute /Users/... imports, Nitro dev runtime can break in /app.
# Clean previous build artifacts before production build.
mkdir -p .nuxt .output
find .nuxt -mindepth 1 -maxdepth 1 -exec rm -rf {} + || true
find .output -mindepth 1 -maxdepth 1 -exec rm -rf {} + || true
@@ -37,4 +36,6 @@ done
npx prisma db push
exec npm run dev -- --host 0.0.0.0 --port 3000
# Run Nuxt in production mode to avoid dev-server chunk timeouts.
npm run build
exec npm run preview -- --host 0.0.0.0 --port 3000