It's probably very obvious to anyone that has already set up their environment in the past, but the test connection at 10:13 will fail unless you've added your public key to your github account.
Can i ask you something? My nextjs app is running just fine, but everyday at 05:00 some "check status" runs in my t2.micro and get "1/2 verified status", and it gets "down", do you know what it would be? :/ everyday at determinated time.... 05:00 or 06:00
You'd probably need to set up a proxy in Nginx to route socket requests to the custom server. Maybe the custom server could be run as a separate process.
Thank you so much My Question is After doing some changes locally and committing it to git hub how to make sure that those changes are reflected in the production
This helped me tremendously! I got my application deployed. Does anyone know how to set up your environment variables in production? I'm using an EC2 instance like the video to host my application.
really good video! I have a question though, is there a potential risk of having the .pem file at the level of the project? Shouldn't we avoid that and if not, obviously we would put that in the .gitignore file but just wondering how to go about this.
Great work there , Just wanted to know how should be handling DB connection on prod server and other config files there ? . Help is really appreciated . Thanks again
ubuntu 1 GiB Memory able to perform "npm run build" mine 512 Mb RAM ubuntu cant do that, need to manually copy and paste the zip to server. so far next js is good. Thanks for the video. I Learn new things here.
Great video, wanted to know how would you add environment variables for this nextjs project and how to configure AWS CodePipeline that works well with this configuration? thank you again :)
Not sure what the best practice for handling environment vars on an ubuntu server. Maybe put them into .bashrc? Haven't used CodePipeline before. I have some videos on CircleCi, which I believe serves the same purpose.
Hello, I was looking at your video channel. We may be helping a company that uses secure images to increase supply chain security and help cloud native development. Would you be willing to help try their software, make a video, and help show devs how to use their tools? This is not an offer, but just to start a conversation about your willingness to take on sponsorship. Please provide me with your email if you are interested. You'd have a chance to look at their technology and decide if it's the type of software that you'd be interested in covering in your channel.
It's probably very obvious to anyone that has already set up their environment in the past, but the test connection at 10:13 will fail unless you've added your public key to your github account.
One of the greatest tutorials I have ever seen.
Thanks
You are 💎 So detailed and easy to understand ❤
Thanks for this great NextJS with Nginx tutorial! Including SSL setup :)!
thank you so much! It was my dream to have a system like that! Keep it up!
I have server side to my nextjs app with api folder and the frontend is not being able to access the endpoint in pm2 next js; how do I resolve that?
Can i ask you something? My nextjs app is running just fine, but everyday at 05:00 some "check status" runs in my t2.micro and get "1/2 verified status", and it gets "down", do you know what it would be? :/ everyday at determinated time.... 05:00 or 06:00
How to do this on windows server please
This video was oddly satisfying to watch
Hi, if i have a custom server in root name is server.ts to handle socketIO so this deploy still working right
You'd probably need to set up a proxy in Nginx to route socket requests to the custom server. Maybe the custom server could be run as a separate process.
how to handle copying `.env.local` from the ecosystem file
you might be able to use the `dotenv` package to load env variables into the file. never tried this before. not sure how it would affect production.
I only have 1 last step left but I get an error when Permission denied (publickey).
thanks, very much. Great tutorial
Glad it was helpful!
Thank you so much
My Question is
After doing some changes locally and committing it to git hub
how to make sure that those changes are reflected in the production
You have to run the deployment command. Or set up a CI/CD pipeline to automate the deployment.
@@fullstackbook Thanks pal
jenkins you need
This helped me tremendously! I got my application deployed. Does anyone know how to set up your environment variables in production? I'm using an EC2 instance like the video to host my application.
There are different ways to do it. You can add them to .bashrc. Or add them to /etc/environment. Or use AWS Parameter Store.
What do I need from Git?
Great video! Thank you! Which is the proper way to bring changes in GitHub repository to production?
Run the `pm2 deploy production` command after you push changes to GitHub.
really good video! I have a question though, is there a potential risk of having the .pem file at the level of the project? Shouldn't we avoid that and if not, obviously we would put that in the .gitignore file but just wondering how to go about this.
You can add it to the .gitignore file to prevent it from getting checked in.
Thanks for the tutorial
Can I do this with yarn instead?
Yes
@@fullstackbook please help me run with yarn . thank sir
Just amazing!!! Helped me a ton. Thank you :)
Thanks you very much 👌
You are welcome
The IP address won't change?
Great work there , Just wanted to know how should be handling DB connection on prod server and other config files there ? . Help is really appreciated .
Thanks again
Check out my other tutorial ruclips.net/video/b73UwoeoWFw/видео.html
ubuntu 1 GiB Memory able to perform "npm run build"
mine 512 Mb RAM ubuntu cant do that, need to manually copy and paste the zip to server.
so far next js is good.
Thanks for the video. I Learn new things here.
Probably need a larger compute instance.
I don't understand what is key.pem?
pem file is used as a key to ssh into the server. The “key” part is an arbitrary name I gave it.
@@fullstackbook I understand.. I was confused, I didn't know if it was the public key of git or the server! Thanks 🙏
what key to include it that file?
how did you solve the github permission denied thingy
Did you make sure you have forward agent set? ruclips.net/video/IwWQG6lEdQQ/видео.html
@@fullstackbook no no i fixed it , it works now ,just that it is not allowing me to open the site becouse of some hydration thingy
Great video, wanted to know how would you add environment variables for this nextjs project and how to configure AWS CodePipeline that works well with this configuration? thank you again :)
Not sure what the best practice for handling environment vars on an ubuntu server. Maybe put them into .bashrc? Haven't used CodePipeline before. I have some videos on CircleCi, which I believe serves the same purpose.
Your link in the description is broken good sir.
Thanks
Thumbs * 1000. Great Video. Don't remove the video.
Hi there your link is not working.
Thanks
WOW you are incredible.
please do with next13
The steps should be very similar, if not the same.
@@fullstackbook allthough nginx is enabled i cant access the simple nginx website ,any advice
great video!
For PM2, why do i need to set the key in ecosystem.config?
Maybe you could try setting your public ssh key on the server instead?
[PM2][WARN] Applications index, service-worker not running, starting...
[PM2][ERROR] Error: Script not found: /home/ubuntu/source/index.js
[PM2][ERROR] Error: Script not found: /home/ubuntu/source/service-worker
post-deploy hook failed
Deploy failed
Deploy failed with exit code: 1
it great !!! thank u! please help me create pipeline countinues
check out new pipeline videos
Really excellent tutorial! 😀Thanks!
Obrigado, salvou meu dia
Você é uma lenda!!!!
Awesome video ++++++++++++++ 🙂
like a pro
such a waste and a grabage.
Hello, thank you for the great tutorial. I am currently facing an error during npm install when running the "pm2 deploy production" command. here is the error:
$ pm2 deploy production
--> Deploying to production environment
--> on host 18.166.xxx.xx
○ deploying origin/main
○ executing pre-deploy-local
○ hook pre-deploy
○ fetching updates
○ full fetch
Fetching origin
○ resetting HEAD to origin/main
HEAD is now at f9ac097 Delete package-lock.json
○ executing post-deploy `source ~/.nvm/nvm.sh && npm install && npm run build && pm2 reload ecosystem.config.js --env production`
[2941:0x5dc0190] 17605 ms: Scavenge 430.4 (452.1) -> 429.3 (451.7) MB, 2.52 / 0.02 ms (average mu = 0.662, current mu = 0.625) allocation failure;
[2941:0x5dc0190] 18090 ms: Mark-Compact (reduce) 461.5 (481.1) -> 457.5 (468.1) MB, 168.28 / 0.03 ms (+ 159.1 ms in 44 steps since start of marking, biggest step 19.4 ms, walltime since start of marking 485 ms) (average mu = 0.613, current mu = 0.565)
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----
1: 0xb84bd6 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [npm install]
2: 0xefeb90 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [npm install]
3: 0xefee77 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [npm install]
4: 0x1110885 [npm install]
5: 0x1128708 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [npm install]
6: 0x10fe821 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [npm install]
7: 0x10ff9b5 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [npm install]
8: 0x10dc0d6 v8::internal::Factory::AllocateRaw(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [npm install]
9: 0x10cdd04 v8::internal::FactoryBase::AllocateRawWithImmortalMap(int, v8::internal::AllocationType, v8::internal::Map, v8::internal::AllocationAlignment) [npm install]
10: 0x10d04e6 v8::internal::FactoryBase::NewRawOneByteString(int, v8::internal::AllocationType) [npm install]
11: 0x1241cb5 v8::internal::JsonParser::MakeString(v8::internal::JsonString const&, v8::internal::Handle) [npm install]
12: 0x1247ccd [npm install]
13: 0x1249c39 v8::internal::JsonParser::ParseJson(v8::internal::Handle) [npm install]
14: 0xf9086e v8::internal::Builtin_JsonParse(int, unsigned long*, v8::internal::Isolate*) [npm install]
15: 0x1971df6 [npm install]
bash: line 1: 2941 Aborted (core dumped) npm install
post-deploy hook failed
Deploy failed
Deploy failed with exit code: 1
This error occurred starting from the 2nd time running the command. For the first time, ubuntu stuck during the "creating optimise pages" stage, and the app was never deployed too. Would greatly appreciate any help, thanks.
Kind of looks like you're running out of memory. You probably need a larger compute instance.
Hello,
I was looking at your video channel. We may be helping a company that uses secure images to increase supply chain security and help cloud native development. Would you be willing to help try their software, make a video, and help show devs how to use their tools?
This is not an offer, but just to start a conversation about your willingness to take on sponsorship. Please provide me with your email if you are interested.
You'd have a chance to look at their technology and decide if it's the type of software that you'd be interested in covering in your channel.
which company is it?
@@fullstackbook Thank you for your response. Can you please provide me with your email so I can provide more information?
@@fullstackbook Hello, if you provide me with your email, I can send you more information.