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

  Рет қаралды 45,674

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
Disclaimer: this is a sponsored video (paid). It's your responsibility to evaluate safety, accuracy and other relevant parts of the reviewed product.
👉 NEW React & Next.js Course: bytegrad.com/courses/professi...
Hi, I'm Wesley. I'm a brand ambassador for Kinde (paid sponsorship).
👉 Add auth to your app FAST: bit.ly/3QOe1Bh
👉 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 bit.ly/3QOe1Bh
⏱️ 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

Пікірлер: 83
@ByteGrad
@ByteGrad 3 ай бұрын
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 3 ай бұрын
We enjoyed collaborating with you and look forward to more opportunities in the future!
@naolfekadu6101
@naolfekadu6101 10 күн бұрын
more devops content please, this was really helpful
@frankyb702
@frankyb702 2 ай бұрын
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 3 ай бұрын
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 3 ай бұрын
Yes, please CI/CD
@ronaldtejada8846
@ronaldtejada8846 2 ай бұрын
Definitely pls
@julienjoseph-agathe7447
@julienjoseph-agathe7447 Ай бұрын
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)
@aolowude
@aolowude 3 ай бұрын
You don't miss with the videos. Ive never veen happien than since i chose Next JS, abd dockerizing is huge! 🙌🏾
@jagdish1o1
@jagdish1o1 2 ай бұрын
Few weeks back, i scratched my head for this and you make it look so simple. Thank you so much! Saved!
@sorintautu5025
@sorintautu5025 3 ай бұрын
Every time I am stuck you post a video on that certain topic. Good content!
@rasalas91
@rasalas91 2 күн бұрын
You're jumping over the "important" bits quite quickly, but it helped a lot - thanks!
@Alex.Shalda
@Alex.Shalda 2 ай бұрын
you're a life-saver!!!! exactly what I needed at work! Cannot thank you enough!!!!!!!!!!!!!
@strippd
@strippd 2 ай бұрын
Dying for a loadbalanced prod tutorial! Thanks subbed!
@vinniv6806
@vinniv6806 3 ай бұрын
This is the content I like. Hats off, congrats.
@ByteGrad
@ByteGrad 3 ай бұрын
Enjoy!
@alaeddinemenai5380
@alaeddinemenai5380 3 ай бұрын
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.
@SlavaBezgachev
@SlavaBezgachev 3 ай бұрын
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
@alarafatsiddique9362
@alarafatsiddique9362 6 күн бұрын
amazing ...just loved it...could you please make another video adding Github Actions for CI/CD with the current video !....that would be amazing...thanks in advance
@qianyisha7891
@qianyisha7891 3 ай бұрын
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).
@imsarvesh_
@imsarvesh_ Ай бұрын
I recently joined your channel. I want to tell you that your channel has most advance content than anywhere else. ❤
@subhranshudas8862
@subhranshudas8862 3 ай бұрын
exactly what i was looking for!
@MeerUzairWasHere
@MeerUzairWasHere 3 ай бұрын
Nice one! you can use automatic port mapping as you exposed the PORT in Dockerfile e.g.( docker run -P "image )
@illuminaughty666
@illuminaughty666 2 ай бұрын
Great efforts indeed! A tutorial of rebuild nextjs app after git push would be cool thing to see on this channel
@SundayOchuko
@SundayOchuko 24 күн бұрын
Thanks alot for this short and very helpful tutor
@farrukhfida212
@farrukhfida212 2 ай бұрын
Nice and simple and more than that to the point
@RoublyGroup
@RoublyGroup 2 ай бұрын
thank you very much you saved my life
@naylord5
@naylord5 3 ай бұрын
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!
@cybor-gg
@cybor-gg 3 ай бұрын
Just wanted to say I appreciate the content! Keep up the good work :)
@ByteGrad
@ByteGrad 3 ай бұрын
Thanks, will do!
@gorkxs
@gorkxs Ай бұрын
You are a life saver. Thank you
@vincentpena7017
@vincentpena7017 3 ай бұрын
Great content mate! More of this please. Self hosting ftw!
@alecost2622
@alecost2622 3 ай бұрын
Thank you. Thats very useful information.
@wilbertdune
@wilbertdune 3 ай бұрын
Continue this with CI/CD next video.
@shimju
@shimju 26 күн бұрын
Highly informative video. Can you please create another Part2 video regarding how to integrate GitHub Repo and using GitHub Actions create a new Docker image and automate the above Workflow. That would be very helpful. Thank you Sir.
@darkcss1054
@darkcss1054 3 ай бұрын
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?
@JoseWaldier
@JoseWaldier 3 ай бұрын
webdevcody needs this video.
@DanielPenaloza-fj8yo
@DanielPenaloza-fj8yo 2 ай бұрын
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 3 ай бұрын
wow, thank you very much, it is appreciated, very good video
@raj_talks_tech
@raj_talks_tech 2 ай бұрын
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."
@seyfallahrouini3412
@seyfallahrouini3412 2 ай бұрын
Thank you so much
@martinharyanto4465
@martinharyanto4465 3 ай бұрын
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!
@snbwcs
@snbwcs Ай бұрын
This is great content. I would suggest doing a video about automated workflow with Github Actions like you suggested in the video (and maybe using the Docker Hub this time ?), that would be amazing !
@SugengWahyudi
@SugengWahyudi 3 ай бұрын
Great.., Please try dockerize Next js with Prisma
@RationalDissonances
@RationalDissonances 3 ай бұрын
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
@vazy1902
@vazy1902 3 ай бұрын
Hi, can you do dockerize with env file in your project too. Thanks you so much
@mohdsahil226
@mohdsahil226 2 ай бұрын
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.
@alvaro-escalante-naves
@alvaro-escalante-naves 2 ай бұрын
So for production you reverse proxy that 3000 port to something else with Nginx or that's something you would do within docker?
@abishekbaiju1705
@abishekbaiju1705 2 ай бұрын
Consider making a video about connecting ssl and domain to this vps.
@binhexoct
@binhexoct 2 ай бұрын
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?
@giannifed
@giannifed 3 ай бұрын
Thank you. Do You use a proxy server like nginx?
@danyacoding
@danyacoding 2 ай бұрын
Does that mean that I can use websocket protocol & keep connection with backend if it's dockerizable?
@dirtysouth3291
@dirtysouth3291 3 ай бұрын
Great, can you make one for ci/cd pipelines??
@dodosaurus4875
@dodosaurus4875 3 ай бұрын
hey ByteGrad, have you switched to MacOS recently from Windows?
@user-us3bs8px3m
@user-us3bs8px3m 3 ай бұрын
How to optimize the performance of Next App similarly Vercel do.Usually Next App deployed on vercel is faster.
@youhan96
@youhan96 3 ай бұрын
Is there a way to automate this when you change the code? to build a new docker image and deploy it to the VPS?
@miguelangelcabrera2227
@miguelangelcabrera2227 3 ай бұрын
Thanks for share this!.. btw can provide de github repository?
@yasseralsaidi
@yasseralsaidi 2 ай бұрын
nice thank you, please can you do a video about github action.
@asadsalehumar1011
@asadsalehumar1011 2 ай бұрын
solid!
@Ecommerce_Support
@Ecommerce_Support 18 күн бұрын
Make sure you have implemented anomaly detection on the VPS. 💸
@Adrian_Galilea
@Adrian_Galilea 2 ай бұрын
What about caching, ISR SSR and so on
@kennethlau8108
@kennethlau8108 3 ай бұрын
This only works for a single standalone but what about horizontal scaling on docker containers for nextjs ?
@kale_bhai
@kale_bhai 3 ай бұрын
Now, do a kube cluster
@madhurchaturvedi5551
@madhurchaturvedi5551 3 ай бұрын
Sir please make JavaScript interview technical coding interview questions videos and great video keep it up
@deaaaldeen1525
@deaaaldeen1525 3 ай бұрын
How to control route and api caching on next js project that not deployed on varcel environment?😢
@lovrozagar3729
@lovrozagar3729 3 ай бұрын
It would be cool if you explain at the start what a VPS is and what are the benefits.
@mma-dost
@mma-dost 3 ай бұрын
Hey, can you make a crash course on micro frontend and module federation please if possible.
@NazarBrunarskyi
@NazarBrunarskyi 2 ай бұрын
can you do please an instruction on how Dockerize nest js app????
@sunilchannelvlog3743
@sunilchannelvlog3743 2 ай бұрын
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?
@trxsson
@trxsson 2 ай бұрын
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-ih1on8ks5z
@user-ih1on8ks5z 3 ай бұрын
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 3 ай бұрын
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.
@boyywnkobe
@boyywnkobe 2 ай бұрын
What mac do u use?
@SomeRandomDev-dx2te
@SomeRandomDev-dx2te Ай бұрын
i think he is using M1 or M2 macbook
@LOFIBOT-bp6hm
@LOFIBOT-bp6hm 2 ай бұрын
I prefer dockerize only the build
@virtuoz-ru
@virtuoz-ru 2 ай бұрын
Dockerize Nuxt.js & Deploy to VPS
@deeperlayer
@deeperlayer 2 ай бұрын
Lmao, another F for mac users. thx for the info man
@invincibearofficial
@invincibearofficial 3 ай бұрын
Eurgh, another video where you don't put the code in a github repo for us to reference :(
The BEST way to host Next.js websites
17:37
ByteGrad
Рет қаралды 24 М.
All 29 Next.js Mistakes Beginners Make
1:45:10
ByteGrad
Рет қаралды 76 М.
My little bro is funny😁  @artur-boy
00:18
Andrey Grechka
Рет қаралды 11 МЛН
ОДИН ДЕНЬ ИЗ ДЕТСТВА❤️ #shorts
00:59
BATEK_OFFICIAL
Рет қаралды 8 МЛН
Top 7 Ways to 10x Your API Performance
6:05
ByteByteGo
Рет қаралды 312 М.
Using docker in unusual ways
12:58
Dreams of Code
Рет қаралды 409 М.
Why I'd never host my apps on a VPS
13:43
Web Dev Cody
Рет қаралды 30 М.
NextJS Tutorial - All 12 Concepts You Need to Know
44:38
ByteGrad
Рет қаралды 248 М.
The Most Important Skill You Never Learned
34:56
Web Dev Simplified
Рет қаралды 165 М.
Coolify Crash Course | Self Host 101 | Secure Set up
1:29:06
My little bro is funny😁  @artur-boy
00:18
Andrey Grechka
Рет қаралды 11 МЛН