fix: use standalone server for Next.js in Docker
Replace 'next start' with 'node server.js' to properly utilize Next.js standalone output mode in Docker deployments. Changes: - Update supervisord.conf to run standalone server - Update supervisord.single.conf to run standalone server - Update package.json start script for consistency This eliminates the startup warning and follows Next.js best practices for optimized Docker deployments.
This commit is contained in:
parent
f92c42a5a4
commit
50157c3c79
3 changed files with 3 additions and 3 deletions
|
|
@ -5,7 +5,7 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"start": "next start -p ${PORT:-8502}",
|
"start": "node .next/standalone/server.js",
|
||||||
"lint": "next lint"
|
"lint": "next lint"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ autostart=true
|
||||||
startsecs=3
|
startsecs=3
|
||||||
|
|
||||||
[program:frontend]
|
[program:frontend]
|
||||||
command=bash -c "/app/scripts/wait-for-api.sh && npm run start"
|
command=bash -c "/app/scripts/wait-for-api.sh && node server.js"
|
||||||
directory=/app/frontend
|
directory=/app/frontend
|
||||||
environment=NODE_ENV="production",PORT="8502"
|
environment=NODE_ENV="production",PORT="8502"
|
||||||
passenv=API_URL,NEXT_PUBLIC_API_URL,INTERNAL_API_URL
|
passenv=API_URL,NEXT_PUBLIC_API_URL,INTERNAL_API_URL
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ autostart=true
|
||||||
startsecs=3
|
startsecs=3
|
||||||
|
|
||||||
[program:frontend]
|
[program:frontend]
|
||||||
command=bash -c "/app/scripts/wait-for-api.sh && npm run start"
|
command=bash -c "/app/scripts/wait-for-api.sh && node server.js"
|
||||||
directory=/app/frontend
|
directory=/app/frontend
|
||||||
environment=NODE_ENV="production",PORT="8502"
|
environment=NODE_ENV="production",PORT="8502"
|
||||||
passenv=API_URL,NEXT_PUBLIC_API_URL,INTERNAL_API_URL
|
passenv=API_URL,NEXT_PUBLIC_API_URL,INTERNAL_API_URL
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue