forked from freeleaps/freeleaps-pub
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1e3b0b6cd8 |
@ -814,6 +814,14 @@ if true ; then
|
|||||||
--link-workspace-packages false \\
|
--link-workspace-packages false \\
|
||||||
--store-dir /home/tmp/.pnpm-store
|
--store-dir /home/tmp/.pnpm-store
|
||||||
|
|
||||||
|
# Fix FormData issue for Node.js environment
|
||||||
|
echo "[FRONTEND] \$(date '+%Y-%m-%d %H:%M:%S') Installing form-data for Node.js compatibility..."
|
||||||
|
pnpm add form-data@^4.0.0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# 4️⃣ Build the frontend
|
# 4️⃣ Build the frontend
|
||||||
pnpm run build
|
pnpm run build
|
||||||
|
|
||||||
@ -1337,6 +1345,12 @@ compile_frontend_service() {
|
|||||||
|
|
||||||
echo "[FRONTEND] \$(date '+%Y-%m-%d %H:%M:%S') Starting frontend compilation and startup..."
|
echo "[FRONTEND] \$(date '+%Y-%m-%d %H:%M:%S') Starting frontend compilation and startup..."
|
||||||
|
|
||||||
|
# Set environment variables to fix FormData issue
|
||||||
|
export NODE_ENV=development
|
||||||
|
export NODE_OPTIONS="--experimental-global-webcrypto"
|
||||||
|
export VITE_NODE_OPTIONS="--experimental-global-webcrypto"
|
||||||
|
export VITE_SSR=false
|
||||||
|
|
||||||
# Start the frontend service (pnpm run dev starts both Vue and Nuxt)
|
# Start the frontend service (pnpm run dev starts both Vue and Nuxt)
|
||||||
echo "[FRONTEND] \$(date '+%Y-%m-%d %H:%M:%S') Starting frontend applications (Vue & Nuxt) via pnpm run dev..."
|
echo "[FRONTEND] \$(date '+%Y-%m-%d %H:%M:%S') Starting frontend applications (Vue & Nuxt) via pnpm run dev..."
|
||||||
# make sure the output of pnpm run dev is redirected to the log file
|
# make sure the output of pnpm run dev is redirected to the log file
|
||||||
@ -1348,7 +1362,7 @@ compile_frontend_service() {
|
|||||||
|
|
||||||
# Check the health of the frontend services (check Nginx endpoint after starting it)
|
# Check the health of the frontend services (check Nginx endpoint after starting it)
|
||||||
# Health check now needs to wait for Nginx to be up and proxying correctly
|
# Health check now needs to wait for Nginx to be up and proxying correctly
|
||||||
MAX_ATTEMPTS=25
|
MAX_ATTEMPTS=30
|
||||||
ATTEMPT=0
|
ATTEMPT=0
|
||||||
APPS_READY=false
|
APPS_READY=false
|
||||||
echo "[FRONTEND] \$(date '+%Y-%m-%d %H:%M:%S') Waiting for frontend applications to become ready..."
|
echo "[FRONTEND] \$(date '+%Y-%m-%d %H:%M:%S') Waiting for frontend applications to become ready..."
|
||||||
@ -1358,20 +1372,36 @@ compile_frontend_service() {
|
|||||||
NUXT_PORT=3001
|
NUXT_PORT=3001
|
||||||
VUE_READY=false
|
VUE_READY=false
|
||||||
NUXT_READY=false
|
NUXT_READY=false
|
||||||
|
|
||||||
|
# Check if processes are running
|
||||||
|
echo "[FRONTEND] \$(date '+%Y-%m-%d %H:%M:%S') Checking if frontend processes are running..."
|
||||||
|
if ps -p \$PNPM_PID > /dev/null; then
|
||||||
|
echo "[FRONTEND] \$(date '+%Y-%m-%d %H:%M:%S') pnpm process (PID: \$PNPM_PID) is running."
|
||||||
|
else
|
||||||
|
echo "[FRONTEND] \$(date '+%Y-%m-%d %H:%M:%S') [WARNING] pnpm process (PID: \$PNPM_PID) is not running."
|
||||||
|
fi
|
||||||
|
|
||||||
while [ \$ATTEMPT -lt \$MAX_ATTEMPTS ]; do
|
while [ \$ATTEMPT -lt \$MAX_ATTEMPTS ]; do
|
||||||
# check the Vue port
|
# check the Vue port
|
||||||
if ! \$VUE_READY && curl --output /dev/null --silent --head --fail http://localhost:\${VUE_PORT}; then
|
if ! \$VUE_READY && curl --output /dev/null --silent --head --fail http://localhost:\${VUE_PORT}; then
|
||||||
echo "[FRONTEND] \$(date '+%Y-%m-%d %H:%M:%S') Vue app (port \${VUE_PORT}) seems ready."
|
echo "[FRONTEND] \$(date '+%Y-%m-%d %H:%M:%S') Vue app (port \${VUE_PORT}) seems ready."
|
||||||
VUE_READY=true
|
VUE_READY=true
|
||||||
fi
|
fi
|
||||||
# check the Nuxt port
|
# check the Nuxt port - try both /home/ and root path
|
||||||
if ! \$NUXT_READY && curl --output /dev/null --silent --head --fail http://localhost:\${NUXT_PORT}/home/; then
|
if ! \$NUXT_READY; then
|
||||||
echo "[FRONTEND] \$(date '+%Y-%m-%d %H:%M:%S') Nuxt app (port \${NUXT_PORT}) seems ready."
|
if curl --output /dev/null --silent --head --fail http://localhost:\${NUXT_PORT}/home/; then
|
||||||
NUXT_READY=true
|
echo "[FRONTEND] \$(date '+%Y-%m-%d %H:%M:%S') Nuxt app (port \${NUXT_PORT}) seems ready."
|
||||||
|
NUXT_READY=true
|
||||||
|
elif curl --output /dev/null --silent --head --fail http://localhost:\${NUXT_PORT}/; then
|
||||||
|
echo "[FRONTEND] \$(date '+%Y-%m-%d %H:%M:%S') Nuxt app (port \${NUXT_PORT}) seems ready (root path)."
|
||||||
|
NUXT_READY=true
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if \$VUE_READY && \$NUXT_READY; then
|
# If Vue is ready but Nuxt is not, we can proceed with just Vue
|
||||||
|
if \$VUE_READY; then
|
||||||
APPS_READY=true
|
APPS_READY=true
|
||||||
|
echo "[FRONTEND] \$(date '+%Y-%m-%d %H:%M:%S') Vue app is ready. Proceeding with Vue only."
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user