fix(lxc): copy static and public folders to standalone directory for asset serving
This commit is contained in:
parent
d4a08f236d
commit
58a35a0c44
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "my-weekly-todo-list",
|
||||
"version": "1.10.4",
|
||||
"version": "1.10.5",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "my-weekly-todo-list",
|
||||
"version": "1.10.4",
|
||||
"version": "1.10.5",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@auth/prisma-adapter": "^2.11.1",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "my-weekly-todo-list",
|
||||
"version": "1.10.4",
|
||||
"version": "1.10.5",
|
||||
"description": "A web-based weekly task management application that organizes to-dos and calendar events in a single, intuitive weekly view",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
@ -52,6 +52,11 @@ if [ ! -d "$NEXT_DIR" ] || [ "$LOCAL" != "$REMOTE" ]; then
|
||||
|
||||
log "Building application..."
|
||||
npm run build 2>&1 | tee -a "$LOG_FILE"
|
||||
|
||||
log "Preparing standalone directory (copying static assets)..."
|
||||
cp -r public .next/standalone/ 2>&1 | tee -a "$LOG_FILE"
|
||||
mkdir -p .next/standalone/.next/static 2>&1 | tee -a "$LOG_FILE"
|
||||
cp -r .next/static .next/standalone/.next/ 2>&1 | tee -a "$LOG_FILE"
|
||||
fi
|
||||
|
||||
log "=== Boot update finished (verified/rebuilt) ==="
|
||||
|
||||
@ -23,6 +23,11 @@ npx prisma generate
|
||||
echo -e "${YELLOW}Step 5: Building application...${NC}"
|
||||
npm run build
|
||||
|
||||
echo -e "${YELLOW}Step 5.5: Preparing standalone directory (copying static assets)...${NC}"
|
||||
cp -r public .next/standalone/
|
||||
mkdir -p .next/standalone/.next/static
|
||||
cp -r .next/static .next/standalone/.next/
|
||||
|
||||
echo -e "${YELLOW}Step 6: Restarting server with PM2 (Standalone Mode)...${NC}"
|
||||
# Delete old process if it exists to ensure fresh config
|
||||
pm2 delete my-weekly-todo || true
|
||||
|
||||
Loading…
Reference in New Issue
Block a user