Dockerize Next.js & Deploy to VPS (EASY!)

  Рет қаралды 36,103

ByteGrad

ByteGrad

Күн бұрын

#Hivelocity #VPS #VPShosting #ad #collaboration
Get one month of VPS FREE at hivelocityinc.net/3SfVjnB. Use code BYTEGRAD1 at checkout. Learn more about Hivelocity’s VPS: hivelocityinc.net/3s3OcUF
Hi, I'm Wesley. I'm a brand ambassador for Kinde (paid sponsorship).
👉 Check out Kinde for auth and more kinde.com
👉 NEW React & Next.js Course: bytegrad.com/courses/professi...
👉 Professional JavaScript Course: bytegrad.com/courses/professi...
👉 Professional CSS Course: bytegrad.com/courses/professi...
👉 Web development roadmap 2024 & 2025: email.bytegrad.com
👉 Email newsletter (BIG update soon): email.bytegrad.com
👉 Discord: all my courses have a private Discord where I actively participate
👉 Kinde: check out Kinde for auth and more kinde.com
⏱️ Timestamps:
00:00 Next.js example overview
01:18 Hosting with Docker is easier than without
01:32 Preparation
02:20 Dockerize Next.js (simple example)
06:45 Dockerize Next.js (better)
08:25 VPS
09:07 GitHub container registry
11:02 Build for AMD64
12:50 Change name / tag of image
14:03 Docker on VPS setup
17:58 Dockerized Next.js on VPS!!
#webdevelopment #programming #coding #reactjs #nextjs

Пікірлер: 74
@ByteGrad
@ByteGrad Ай бұрын
I had a great time working with Hivelocity's VPS again. Get one month of VPS FREE at hivelocityinc.net/3SfVjnB. Use code BYTEGRAD1 at checkout. Learn more about Hivelocity’s VPS: hivelocityinc.net/3s3OcUF
@HivelocityNet
@HivelocityNet Ай бұрын
We enjoyed collaborating with you and look forward to more opportunities in the future!
@frankyb702
@frankyb702 Ай бұрын
This is amazing. I would love to see a solution for: 1. Using the docker container as a dev container, meaning coding on the container dev server. 2. A solution to rebuild the next app for both dev and production on git push. Making it a replacement for vercel. 3. Any type of autoscaling,
@BehrouzAsghari
@BehrouzAsghari Ай бұрын
Hello, thank you very much for providing this short and practical content, please make other videos of these practical and interdisciplinary skills (CI/CD) for frontend developers.
@alejandroechavarria539
@alejandroechavarria539 Ай бұрын
Yes, please CI/CD
@ronaldtejada8846
@ronaldtejada8846 Ай бұрын
Definitely pls
@julienjoseph-agathe7447
@julienjoseph-agathe7447 4 күн бұрын
Yes CI/CD with build job and some public ENV variable.. How to handle PUBLIC_NEXT_** when the image is created from the CI/CD and env variable are not stored in repo (no env.production in repo)
@imsarvesh_
@imsarvesh_ Күн бұрын
I recently joined your channel. I want to tell you that your channel has most advance content than anywhere else. ❤
@aolowude
@aolowude Ай бұрын
You don't miss with the videos. Ive never veen happien than since i chose Next JS, abd dockerizing is huge! 🙌🏾
@Alex.Shalda
@Alex.Shalda 14 күн бұрын
you're a life-saver!!!! exactly what I needed at work! Cannot thank you enough!!!!!!!!!!!!!
@sorintautu5025
@sorintautu5025 Ай бұрын
Every time I am stuck you post a video on that certain topic. Good content!
@jagdish1o1
@jagdish1o1 Ай бұрын
Few weeks back, i scratched my head for this and you make it look so simple. Thank you so much! Saved!
@alaeddinemenai5380
@alaeddinemenai5380 Ай бұрын
Thank you @ByteGrad for your videos. Your videos are simple and any engineer can understand what your bring. There is common issue in NextJS and Docker which is access the System Env variables after the build is done in runtime. Please you can check that issue and it is still open for long time. You may share a video about how to solve that issue.
@strippd
@strippd Ай бұрын
Dying for a loadbalanced prod tutorial! Thanks subbed!
@raj_talks_tech
@raj_talks_tech 12 күн бұрын
Great video, just clearing the confusion around EXPOSE keyword on Docker. "The EXPOSE instruction doesn't actually publish the port. It functions as a type of documentation between the person who builds the image and the person who runs the container, about which ports are intended to be published. To publish the port when running the container, use the -p flag on docker run to publish and map one or more ports, or the -P flag to publish all exposed ports and map them to high-order ports."
@qianyisha7891
@qianyisha7891 Ай бұрын
Fantastic content! I've recently done something similar for my own projects: containerizing and setting up CI/CD. It will be interesting for me to see how you continue with CI/CD in this video, and perhaps even more so, how to deploy a web server + database using Docker and Kubernetes while also integrating CI/CD (which is exactly what I'm trying to figure out now LOL).
@SlavaBezgachev
@SlavaBezgachev Ай бұрын
Thanks for the video! I completely forgot that I can use the GH registry, that actually solves a small problem I had with where to store the built containers
@MeerUzairWasHere
@MeerUzairWasHere Ай бұрын
Nice one! you can use automatic port mapping as you exposed the PORT in Dockerfile e.g.( docker run -P "image )
@illuminaughty666
@illuminaughty666 Ай бұрын
Great efforts indeed! A tutorial of rebuild nextjs app after git push would be cool thing to see on this channel
@naylord5
@naylord5 Ай бұрын
Excelent content master!! Thank you so much for sharing. It would be really cool if you complement this video with a github action for building the updated image after a master commit, and push it to the VPS. Thank you in advance!
@vinniv6806
@vinniv6806 Ай бұрын
This is the content I like. Hats off, congrats.
@ByteGrad
@ByteGrad Ай бұрын
Enjoy!
@subhranshudas8862
@subhranshudas8862 Ай бұрын
exactly what i was looking for!
@cybor-gg
@cybor-gg Ай бұрын
Just wanted to say I appreciate the content! Keep up the good work :)
@ByteGrad
@ByteGrad Ай бұрын
Thanks, will do!
@vincentpena7017
@vincentpena7017 Ай бұрын
Great content mate! More of this please. Self hosting ftw!
@farrukhfida212
@farrukhfida212 Ай бұрын
Nice and simple and more than that to the point
@darkcss1054
@darkcss1054 Ай бұрын
I can finally say that I climbed the steep curve of learning React/Next.js and that's in great part thanks to you. Thank you so much. You're really making a difference as a content creator. Related to this video, Is it possible to set a Python FastAPI backend and a Next.js front end on the same container or would I have to use 2 separate containers?
@abishekbaiju1705
@abishekbaiju1705 21 күн бұрын
Consider making a video about connecting ssl and domain to this vps.
@alecost2622
@alecost2622 Ай бұрын
Thank you. Thats very useful information.
@martinharyanto4465
@martinharyanto4465 Ай бұрын
Great content. Can you explain the deployment part with GCP? I am not sure since they should have container registry, but how to refer the docker etc.. Very nice content!
@wilbertdune
@wilbertdune Ай бұрын
Continue this with CI/CD next video.
@RoublyGroup
@RoublyGroup 12 күн бұрын
thank you very much you saved my life
@DanielPenaloza-fj8yo
@DanielPenaloza-fj8yo Ай бұрын
Thanks a lot! You really explained this process perfectly, can we do this with many Node.js apps with different ports and add CI/CD?
@404-not-found-service
@404-not-found-service Ай бұрын
wow, thank you very much, it is appreciated, very good video
@seyfallahrouini3412
@seyfallahrouini3412 Ай бұрын
Thank you so much
@vazy1902
@vazy1902 Ай бұрын
Hi, can you do dockerize with env file in your project too. Thanks you so much
@JoseWaldier
@JoseWaldier Ай бұрын
webdevcody needs this video.
@RationalDissonances
@RationalDissonances Ай бұрын
In comparison to deploying on Vercel, what features / abilities we will lose if we use docker? I think the obvious ones are serverless functions, edge functions and edge caching. basically we will have only 1 server from 1 geo to serve all of the world
@mohdsahil226
@mohdsahil226 Ай бұрын
Hi Thank you for great content. Would you please also help on how to setup dev branch on sub domain, since the port is same, it always goes to main branch. I am using nginx.
@asadsalehumar1011
@asadsalehumar1011 Ай бұрын
solid!
@SugengWahyudi
@SugengWahyudi Ай бұрын
Great.., Please try dockerize Next js with Prisma
@madhurchaturvedi5551
@madhurchaturvedi5551 Ай бұрын
Sir please make JavaScript interview technical coding interview questions videos and great video keep it up
@binhexoct
@binhexoct Ай бұрын
Great video. Question: did you not get an error of ECONNREFUSED for the route handler when you did the "build" (npm run build)? How did you avoid it?
@miguelangelcabrera2227
@miguelangelcabrera2227 Ай бұрын
Thanks for share this!.. btw can provide de github repository?
@lovrozagar3729
@lovrozagar3729 Ай бұрын
It would be cool if you explain at the start what a VPS is and what are the benefits.
@trxsson
@trxsson 18 күн бұрын
Bonus tip: you can just connect that to a cloudflare tunnel and thus don’t have to worry about connecting your domain properly and ssl certificates
@user-us3bs8px3m
@user-us3bs8px3m Ай бұрын
How to optimize the performance of Next App similarly Vercel do.Usually Next App deployed on vercel is faster.
@giannifed
@giannifed Ай бұрын
Thank you. Do You use a proxy server like nginx?
@dirtysouth3291
@dirtysouth3291 Ай бұрын
Great, can you make one for ci/cd pipelines??
@yasseralsaidi
@yasseralsaidi Ай бұрын
nice thank you, please can you do a video about github action.
@mma-dost
@mma-dost Ай бұрын
Hey, can you make a crash course on micro frontend and module federation please if possible.
@kale_bhai
@kale_bhai Ай бұрын
Now, do a kube cluster
@deaaaldeen1525
@deaaaldeen1525 Ай бұрын
How to control route and api caching on next js project that not deployed on varcel environment?😢
@safa_jahan
@safa_jahan Ай бұрын
Is there a way to automate this when you change the code? to build a new docker image and deploy it to the VPS?
@dodosaurus4875
@dodosaurus4875 Ай бұрын
hey ByteGrad, have you switched to MacOS recently from Windows?
@danyacoding
@danyacoding Ай бұрын
Does that mean that I can use websocket protocol & keep connection with backend if it's dockerizable?
@alvaro-escalante-naves
@alvaro-escalante-naves 18 күн бұрын
So for production you reverse proxy that 3000 port to something else with Nginx or that's something you would do within docker?
@kennethlau8108
@kennethlau8108 Ай бұрын
This only works for a single standalone but what about horizontal scaling on docker containers for nextjs ?
@boyywnkobe
@boyywnkobe Ай бұрын
What mac do u use?
@Adrian_Galilea
@Adrian_Galilea Ай бұрын
What about caching, ISR SSR and so on
@NazarBrunarskyi
@NazarBrunarskyi 11 күн бұрын
can you do please an instruction on how Dockerize nest js app????
@sunilchannelvlog3743
@sunilchannelvlog3743 Ай бұрын
can i ask why dont we just git clone our repo after sending our code to github repo , then run that using terminal in the vps, i am not sure why we are using docker is it necessary?
@virtuoz-ru
@virtuoz-ru Ай бұрын
Dockerize Nuxt.js & Deploy to VPS
@user-ih1on8ks5z
@user-ih1on8ks5z Ай бұрын
Hi, I am still confused why such small project takes above 1GB image size ?, some projects I built almost have 3GB image size
@darkcss1054
@darkcss1054 Ай бұрын
Because Node.js and all node_modules have to be copied to the image. It is supposed to be a standalone container that has all you need to run your application, even denying the necessity of a browser or a NodeJS installation.
@LOFIBOT-bp6hm
@LOFIBOT-bp6hm Ай бұрын
I prefer dockerize only the build
@deeperlayer
@deeperlayer 22 күн бұрын
Lmao, another F for mac users. thx for the info man
@invincibearofficial
@invincibearofficial Ай бұрын
Eurgh, another video where you don't put the code in a github repo for us to reference :(
All 29 Next.js Mistakes Beginners Make
1:45:10
ByteGrad
Рет қаралды 28 М.
The BEST way to host Next.js websites
17:37
ByteGrad
Рет қаралды 18 М.
I MADE A CARDBOARD SWING!#asmr
00:40
HAYATAKU はやたく
Рет қаралды 28 МЛН
Glow Stick Secret (part 2) 😱 #shorts
00:33
Mr DegrEE
Рет қаралды 9 МЛН
Эта Мама Испортила Гендер-Пати 😂
00:40
Глеб Рандалайнен
Рет қаралды 7 МЛН
The World's Fastest Cleaners
00:35
MrBeast
Рет қаралды 127 МЛН
What Everyone Missed About The Linux Hack
20:24
Theo - t3․gg
Рет қаралды 271 М.
Deploy Next Js on Cloudflare
3:57
Sphorb
Рет қаралды 4 М.
This tool makes self hosting simple
5:59
Web Dev Cody
Рет қаралды 45 М.
TypeScript Generics are EASY once you know this
22:21
ByteGrad
Рет қаралды 117 М.
You might not need useEffect() ...
21:45
Academind
Рет қаралды 131 М.
10 common mistakes with the Next.js App Router
20:37
Vercel
Рет қаралды 166 М.
Why I Quit Copilot | Prime Reacts
35:56
ThePrimeTime
Рет қаралды 241 М.
I MADE A CARDBOARD SWING!#asmr
00:40
HAYATAKU はやたく
Рет қаралды 28 МЛН