updates
This commit is contained in:
@@ -221,6 +221,19 @@ if grep -q '"output":\s*"standalone"' next.config.js 2>/dev/null || grep -q "out
|
||||
NODE_ENV=production PORT=$FRONTEND_PORT npm run build
|
||||
fi
|
||||
|
||||
# Ensure public folder is copied to standalone directory
|
||||
if [ ! -d ".next/standalone/public" ]; then
|
||||
echo -e "${BLUE}Copying public folder to standalone directory...${NC}"
|
||||
cp -r public .next/standalone/
|
||||
fi
|
||||
|
||||
# Ensure static folder symlink exists for image optimization
|
||||
if [ ! -L ".next/standalone/.next/static" ] && [ ! -d ".next/standalone/.next/static" ]; then
|
||||
echo -e "${BLUE}Creating symlink for static files...${NC}"
|
||||
mkdir -p .next/standalone/.next
|
||||
ln -s ../../static .next/standalone/.next/static
|
||||
fi
|
||||
|
||||
# Start standalone server with PM2
|
||||
PORT=$FRONTEND_PORT NODE_ENV=production pm2 start node \
|
||||
--name "gnxsoft-frontend" \
|
||||
|
||||
Reference in New Issue
Block a user