Run frontend in production mode during compose startup
This commit is contained in:
@@ -3,8 +3,7 @@ set -euo pipefail
|
|||||||
|
|
||||||
cd "$(dirname "$0")/.."
|
cd "$(dirname "$0")/.."
|
||||||
|
|
||||||
# Prevent path leakage between host Nuxt build cache and Docker runtime.
|
# Clean previous build artifacts before production build.
|
||||||
# If any cache contains absolute /Users/... imports, Nitro dev runtime can break in /app.
|
|
||||||
mkdir -p .nuxt .output
|
mkdir -p .nuxt .output
|
||||||
find .nuxt -mindepth 1 -maxdepth 1 -exec rm -rf {} + || true
|
find .nuxt -mindepth 1 -maxdepth 1 -exec rm -rf {} + || true
|
||||||
find .output -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
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user