How to self host a Next.js application (with Dockerfile overview)

  Рет қаралды 18,480

Web Dev Cody

Web Dev Cody

Күн бұрын

Пікірлер: 58
@loorinho
@loorinho 6 ай бұрын
I love these kind of videos. Short and concise to the point focusing on one thing. Much love from Uganda "Mentor"
@blizzy78
@blizzy78 6 ай бұрын
thanks for mentioning the memory allocator issue, I totally missed that in the docs when I was building my apps
@shockgalaxy9849
@shockgalaxy9849 6 ай бұрын
Just when I started thinking about using railway with next you drop this banger. Thanks a lot
@NaniwaRocky
@NaniwaRocky 6 ай бұрын
Yesss was waiting for this!
@alonsoalarconaguilar7113
@alonsoalarconaguilar7113 6 ай бұрын
Very helpful video, providing an application for my day to day job makes me want to learn Docker 👍
@aham_sammich
@aham_sammich 6 ай бұрын
Super useful video! Thank you!
@boyo_23
@boyo_23 6 ай бұрын
12:00 glibc is the C standard library for most Linux systems. musl is a lightweight alternative to glibc.
@ricko13
@ricko13 6 ай бұрын
im not gonna watch the video right now, but here is your like Cody 👍
@betim667
@betim667 4 ай бұрын
@alaskandonut AHAAAAAAHAHAAHAHAHAAHAHAHAHAHA WHY SO SERIOUSSS AHAHAHAHA (TOMATE BY ID LUIS)
@clayton.schneider
@clayton.schneider 6 ай бұрын
Definitely interested when/if you get that sharp portion figured out
@WebDevCody
@WebDevCody 6 ай бұрын
I tried for another hour. I can’t get this container to correctly work with tunnels when using alpine. It’s like the dns breaks in railway when using alpine. If I wasn’t using tunnels I’m pretty sure you just need to use alpine image and install lib6c like they do in their example.
@damjandjordjevic1994
@damjandjordjevic1994 6 ай бұрын
@@WebDevCody don't the binaries need to be compiled with the musl compiler if you wanna run them on a musl system? Maybe you could look at void linux docs, as they seem to explain some of this musl stuff that I can't seem to comprehend :D
@butwhothehellknows
@butwhothehellknows 6 ай бұрын
Good job babe!!!
@WebDevCody
@WebDevCody 6 ай бұрын
Thanks my love!
@MiadVosoughi
@MiadVosoughi 6 ай бұрын
I remember there was some issues when you want to scale the app by deploying to multiple pods. Not sure if that’s been documented now
@Mirislomovmirjalol
@Mirislomovmirjalol 6 ай бұрын
Have you tried configuring next_public env variables for static pages with docker? I had a lot of issues with that, and couldn’t figure it out. Then i put env keys on docker image (no sensitive data). Unfortunately, on next js, ssr pages and static pages read env keys differently, and i don’t have solution for that
@ahmedjaber8595
@ahmedjaber8595 6 ай бұрын
i can't work without docker anymore thanks for the video
@tsykin
@tsykin 5 ай бұрын
This was very helpful for me to understand self-hosting Next.js! I am also curious what's your average bill for project with postgres and nextjs app?
@chillydill4703
@chillydill4703 6 ай бұрын
About the memory issue, running an SQL-instance will always eat up as much memory as it can due to caching over time etc, at least for MS SQL, not sure about SQLite but could be worth checking out. So I always set a memory limit for the SQL instance.
@farzadmf
@farzadmf 6 ай бұрын
I'm really curious to know if the built-in server used to serve the Website (by doing `node server.js`) is powerful and robust enough to handle a high load of requests.
@kevins7621
@kevins7621 4 ай бұрын
Thanks, how to you deal with env variables when using Docker self host?
@MightyMoud
@MightyMoud 6 ай бұрын
Triangle company hiding standalone to make sure service cost stay high
@justinleong3967
@justinleong3967 6 ай бұрын
Triangle company 😂
@sandip_1698
@sandip_1698 6 ай бұрын
😂😂😂😂😂
@everythingnaruto5682
@everythingnaruto5682 6 ай бұрын
it's literally there in the docs, and they mention it's good for docker or self hosting.
@rand0mtv660
@rand0mtv660 6 ай бұрын
It's not hidden at all when it comes to deploying examples. I also dislike some things Vercel does, but spreading false information like this is also not correct thing to do.
@nicko9958
@nicko9958 4 ай бұрын
Don't you use compose.yml or haven't you shown it in the video? Would be interesting how you'd setup this file.
@haraldschjlbergevensen4561
@haraldschjlbergevensen4561 4 ай бұрын
What do you think about this vs OpenNext or SST? As far as I know, using Docker means a lot of drawbacks in terms of both speed and memory usage. For example caching is done per docker container, including Image Optimization, Static sites, etc.
@WebDevCody
@WebDevCody 4 ай бұрын
Honestly deploy to a container and benchmark it against vercel. You’ll notice it’s not too bad. You can also scale up a vps a lot to handle lots of load
@iasonaschristoulakis6932
@iasonaschristoulakis6932 2 ай бұрын
SSR PSR etc are features of vercel that cannot reproduced easily on self-hosted next.js app. Is it true? Self host has some limitaiton or reduction on performance?
@dodijacobs
@dodijacobs 3 ай бұрын
Wonderfull content, congratulations .... have you created the alpine version?
@kritsrijakkot9175
@kritsrijakkot9175 5 ай бұрын
When I use docker compose to build app have database and app connection inside. The landing page so slow I don't know because of something but I think database query from docker image database slow or GPU and CPU on Docker Desktop not enough (my nextapp image size 1.2 GB). How to solve this problem? When using everything on local macbook is so fast.
@lili1223a
@lili1223a 4 ай бұрын
my app can't seem to be accessed even though i specified port 8080 on dockerfile and in railway setting
@GUY-i4w
@GUY-i4w 3 ай бұрын
Can you make a video showing how to host next js app with docker + ssl certificate?
@shaked1233
@shaked1233 6 ай бұрын
What are the advantages of railway on aws for nextjs app?
@antidegenerates7449
@antidegenerates7449 5 ай бұрын
Single thread? How you manage restarts?
@patolorde
@patolorde 6 ай бұрын
Great content 👍🤙
@anonAcc575
@anonAcc575 6 ай бұрын
Docker is amazing when it works, but when changing something, debugging issues can be really frustrating.
@gold-junge91
@gold-junge91 6 ай бұрын
❤ Nice!! Thanks for that i have not look in too. Deploy with docker but i get for 3 days the same shit error with GitHub actions, so no i try it with docker over GitHub actions 😅 thank you
@WebDevCody
@WebDevCody 6 ай бұрын
Be careful not to put sensitive arguments when using the ARGS in your doctor file. The doctor documentation warns that you could legal your private building on a public repository you get up actions.
@OniTemitope-cm9lu
@OniTemitope-cm9lu 6 ай бұрын
Whats that VScode theme ??, looks sickk
@sahagarzoumanian7151
@sahagarzoumanian7151 6 ай бұрын
What are the benefits of hosting a Next.js app through a docker container rather than vercel?
@WebDevCody
@WebDevCody 6 ай бұрын
Cheaper, you can setup a websocket server if you want, can do in memory rate limiting, no risk of high bills if ddosed, using something like prisma or dependencies that require binaries will work no problem vs serverless is a pain
@satyak1337
@satyak1337 5 ай бұрын
what is the size of docker file?
@jd_27
@jd_27 6 ай бұрын
thank you Cody
@aymenbachiri-yh2hd
@aymenbachiri-yh2hd 3 ай бұрын
Thanks man
@ahouse73
@ahouse73 6 ай бұрын
I like the idea of using dev containers for development, first of, whats youre opinion on this and can you maybe make a video about it ? For me (beginner) the hot reload just took like 30s or so, this is why I dropped it, but wonder if I did somethig wrong
@WebDevCody
@WebDevCody 6 ай бұрын
I only use containers for dependencies such as the database localy
@ahouse73
@ahouse73 6 ай бұрын
@@WebDevCody what do you dislike about it ? And can you maybe try it, maybe you even like it :) I think the idea is pretty smart to install everything just in those containers and develop in those
@WebDevCody
@WebDevCody 6 ай бұрын
@@ahouse73 I want to make sure we are talking about the same thing. You mean use a docker compose file and volume mount your code inside the container and run your dev server inside the container right?
@ahouse73
@ahouse73 6 ай бұрын
@@WebDevCody yes
@giantseaturtle
@giantseaturtle 6 ай бұрын
Thank you.
@remirth_bergström
@remirth_bergström 6 ай бұрын
I think T3 documentation suggests using standalone for Docker so I never really tried anything else. Crazy if that option is available and not prescribed as default for containerizing
@rand0mtv660
@rand0mtv660 6 ай бұрын
It's actually used in their official Docker example, so they are prescribing it for that exact use case.
@DevDan115
@DevDan115 18 күн бұрын
Railway isn’t working here
@ardianhotii
@ardianhotii 6 ай бұрын
How to do it when I jave 2 docker one for nextjs and one for a nodej express api that is the backend for the nextjs app , how to set the env for the api url in the nextjs dockerfile is it localhost or no
@amershboul9107
@amershboul9107 6 ай бұрын
Self-Hosting Next.js
45:13
leerob
Рет қаралды 82 М.
Do this before you deploy to Vercel
20:28
Web Dev Cody
Рет қаралды 32 М.
Война Семей - ВСЕ СЕРИИ, 1 сезон (серии 1-20)
7:40:31
Семейные Сериалы
Рет қаралды 1,6 МЛН
I'VE MADE A CUTE FLYING LOLLIPOP FOR MY KID #SHORTS
0:48
A Plus School
Рет қаралды 20 МЛН
She wanted to set me up #shorts by Tsuriki Show
0:56
Tsuriki Show
Рет қаралды 8 МЛН
Why is everyone LYING?
7:56
NeetCodeIO
Рет қаралды 377 М.
Dockerize Next.js & Deploy to VPS (EASY!)
19:43
ByteGrad
Рет қаралды 75 М.
NextJS Is Hard To Self Host
39:32
ThePrimeTime
Рет қаралды 125 М.
Why Are Open Source Alternatives So Bad?
13:06
Eric Murphy
Рет қаралды 731 М.
Why I'd never host my apps on a VPS
13:43
Web Dev Cody
Рет қаралды 71 М.
Docker Image BEST Practices - From 1.2GB to 10MB
7:15
Better Stack
Рет қаралды 140 М.
Everything You NEED to Know about Docker
18:26
ForrestKnight
Рет қаралды 54 М.
Self host your Apps with Coolify: Install and Demo
25:23
Brendan O'Connell
Рет қаралды 3,6 М.
10 common mistakes with the Next.js App Router
20:37
Vercel
Рет қаралды 239 М.
Self-Host Next.js 15 on VPS in 8 Minutes (EASY!)
11:29
ByteGrad
Рет қаралды 11 М.
Война Семей - ВСЕ СЕРИИ, 1 сезон (серии 1-20)
7:40:31
Семейные Сериалы
Рет қаралды 1,6 МЛН