0

as the title pretty much says it all, yarn next build/yarn build causes the website to return 'internal server error'. It is hosted on ubuntu with nginx, this is the one-liner I made and use to 'deploy'

yarn next build && pm2 delete WEBSITENAME && pm2 start yarn --name WEBSITENAME -- next start -p 3105 && pm2 save

It takes quite a while to build, during this 1/2 minutes whole website is down, any way I can avoid this? I was thinking having 2 folders running on different ports and switching them from nginx, but it just sounds like a hastle, for sure there must be a better way, please suggest!

Thanks!

ThomasDEV
  • 75
  • 7
  • 2
    Use docker. You can build the containers anywhere, then just pull/start the new version. It will only be down for as long as it takes next to start up in production, which I'm guessing is close to 0 seconds. – super Apr 02 '23 at 20:10

0 Answers0