Can't I create a Full-Stack standalone app with NextJS 14?
Unanswered
ChillBay posted this in #help-forum
ChillBayOP
After few research that I did today on nextjs14 production build, I found no solution to truly making a standalone build that only requires node.js to run the app, and with the standalone build on the next.config.js it just creates a static website, that doesn't even load CSS files and is just html to do in some route that has no functionality like dev server.
I had a talk with #gpt-help, it told the same thing that, its recommended to put the build file in the same development project folder,
I want to make this a standalone app which I can install on multiple computers without the need to install many dependencies or unnecessary development project folder file that user doesn't need except nodejs.
Maybe there are some other workarounds to this because I have not been using NextJS for a long time.
I had a talk with #gpt-help, it told the same thing that, its recommended to put the build file in the same development project folder,
I want to make this a standalone app which I can install on multiple computers without the need to install many dependencies or unnecessary development project folder file that user doesn't need except nodejs.
Maybe there are some other workarounds to this because I have not been using NextJS for a long time.
23 Replies
I want to make this a standalone app which I can install on multiple computers without the need to install many dependencies or unnecessary development project folder file that user doesn't need except nodejs.Not even NPM?
well just
npm i and npm run dev?ChillBayOP
but i cant separate the production server from the development project files
well then just
npm i, npm run build then npm run start :vChillBayOP
ok,
1. go to the project folder
2. run yarn build
3. go to the .next folder and do npm i ?
1. go to the project folder
2. run yarn build
3. go to the .next folder and do npm i ?
no, go to the project folder,
yarnyarn buildyarn startChillBayOP
but it also has all the files that an app user doesnt need
then you can detect which server to use using
process.env.NODE_ENV === "development"ChillBayOP
like the parent folder where there are development codes
if i copy the whole folder there is unnecessary space taken on the other computer
you could try yarn build
then just copy the necessary files such as
.next and package-lock then yarn startim not sure how much of the source does
next needs to next start the next.js serverChillBayOP
yes thats exactly my confusion too
you can try building the project
then deleting the source code and
yarn start and see if it still works :)ChillBayOP
thats what i need to try as I didnt find any other solution from the web resources and AI
good, let me know if it works
ChillBayOP
was just expecting a more standard solution as this solution can invite many bugs
Giant panda
Yeah I was as well confused that I cannot just do
I was following the example below but it was inconsistent with what I had when building.
https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile
node index.js in .next folder or similar.I was following the example below but it was inconsistent with what I had when building.
https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile