Тёмный

Decrease Next.js Docker Image Size 15x 

Frontend Basics
Подписаться 925
Просмотров 20 тыс.
50% 1

Опубликовано:

 

15 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 43   
@tsykin
@tsykin 28 дней назад
I used tips from your video and actually managed to decrease image size from 2GB to 139MB. Thanks a lot! Unfortunately some dockefile steps that you specified are stale, specifically: - CMD - ENV declaration it's an easy fix and I am still very grateful for provided info 👍
@heyjitendra
@heyjitendra 25 дней назад
If you don't mind can you please share what fix did you implement?
@javohirmirzo
@javohirmirzo 20 дней назад
​@heyjitendra do you use latest docker version? It should show warning messages for deprecated syntaxes
@evmoh_it
@evmoh_it 8 дней назад
Thank's for video! Good practice to have one repository for production ready multistage build for Next JS in Docker
@tdkrage
@tdkrage 11 дней назад
This video is amazing! Thank you so much, Would be great to see how to do this for a monorepo setup with multiple next apps and some shared resources.
@zorkname
@zorkname 8 дней назад
I think you can make it even smaller with a `node:lts-bullseye-slim` image. It will always use LTS version, and this image feels the best as I've read.
@Telmosampaio
@Telmosampaio Месяц назад
Great tips, exactly what I was looking for 😊
@frontendbasics
@frontendbasics 2 месяца назад
If you liked the video, don't forget to subscribe. More videos will come
@furkangonulal1355
@furkangonulal1355 10 дней назад
Eyvallah, patronları sevindirecek haber :D
@hima-pro
@hima-pro 10 дней назад
hey bro for standalone builds you still need to add .next/static and public folder do it in the builder stage like this after the build command: $ cp -r .next/static .next/standalone/.next $ cp -r public .next/standalone then copy the standalone folder later in the last stage as you do
@halitiince
@halitiince 11 дней назад
Thank you for the video friend❤ IMHO, you are Turkish right? Your edit & concept the best one I have ever seen 🎉
@frontendbasics
@frontendbasics 11 дней назад
Yes I am. Glad you liked it ❤️
@parthadebnath-n3t
@parthadebnath-n3t Месяц назад
Awsome explanation. Thanks a lot man
@frontendbasics
@frontendbasics Месяц назад
Thanks for the comment ❤️ I am still working on improving my tutorials.
@danxayota9933
@danxayota9933 8 дней назад
please could you make a video on dockerize a ready to run expo app image with all the necessary deps to run
@Emre-qp6fk
@Emre-qp6fk 12 дней назад
Kardeş, thank you very much, I needed it very much.
@frontendbasics
@frontendbasics 11 дней назад
Glad you liked it kanki ❤️
@yusufyalc1n
@yusufyalc1n 11 дней назад
@@frontendbasicshuh?
@mzerone-g6m
@mzerone-g6m 11 дней назад
I am sorry but how is the person make this i do image like this just for developement but for production a 2 phase image one to build application and after that copy build and run using node
@hvms6k
@hvms6k 5 дней назад
Great video! Thanks for sharing. Can I use this approach to develop nextjs web app locally? I mean are there any benefits to create docker image and run it instead of running npm run dev?
@frontendbasics
@frontendbasics 5 дней назад
No need for that. You can use npm run dev for local
@J1ndod1nho
@J1ndod1nho 12 дней назад
Great tips, thanks a lot man 👍🏻
@abiiranathan
@abiiranathan 6 часов назад
What's with the zoom in and out?
@sa2avro
@sa2avro 4 дня назад
environment variables not work...... how to fixed???
@zakir.nuriiev
@zakir.nuriiev 10 дней назад
Thank you for a such nice tip!
@frazuppi4897
@frazuppi4897 9 дней назад
holy shit! thanks a lot!
@dzienisz
@dzienisz 12 дней назад
How stable this setup is? And why it’s not recommended?
@frontendbasics
@frontendbasics 12 дней назад
I think it is stable enough that Next.js recommends it in their documentation. You can check out these two: nextjs.org/docs/app/api-reference/next-config-js/output github.com/vercel/next.js/tree/canary/examples/with-docker
@atovan3236
@atovan3236 12 дней назад
this video is helpful
@igrb
@igrb 10 дней назад
amazing stuff
@frontendbasics
@frontendbasics 10 дней назад
Thanks for the comment ❤️
@ojfy1267
@ojfy1267 12 дней назад
hello what a great video to wathc thanks a lot. I have just one question about the public and static folder how can we upload them to CDN or S3, like whats the configurations that should be included to nextjs to make it work?
@frontendbasics
@frontendbasics 12 дней назад
You can check out assetPrefix option: nextjs.org/docs/app/api-reference/next-config-js/assetPrefix Basically create a structure where the prefix is your cdn link + the commit hash so that it syncs fine.
@itznotabug
@itznotabug 9 дней назад
node-slim?
@avwie132
@avwie132 5 дней назад
People apparently never read any docs…
@hugodsa89
@hugodsa89 9 дней назад
I love you
@reinhard_silaen
@reinhard_silaen 11 дней назад
Why we use this instead of vercel?
@frontendbasics
@frontendbasics 11 дней назад
If you don’t want to use their platform and host it in anywhere else, docker is the way to go
@reinhard_silaen
@reinhard_silaen 10 дней назад
@@frontendbasics is there a way to deploy container for free?
@turculaurentiu91
@turculaurentiu91 2 дня назад
I am pretty sure that you are supposed to build the project on your pipeline before building the docker container and only copy only the build in the docker image, don't build it inside the container.
@princereyes5400
@princereyes5400 17 дней назад
how about docker ram usage?
@frontendbasics
@frontendbasics 15 дней назад
I haven't search that topic but I think it is highly dependent on what your application consists of and how many requests you are getting per second. Let me know if there are magic tricks for optimizing the ram usage as well.
@okanbayulgen
@okanbayulgen 11 дней назад
türk müsün
Далее
КТО БОИТСЯ КЛЕЩЕЙ?? #shorts
00:18
Просмотров 2,1 млн
Implement Clean Architecture in Next.js
53:07
Просмотров 19 тыс.
Dockerize Next.js 14+ App in 2024
4:20
Просмотров 2,7 тыс.
Let's Fix The Fatal Flaw in TypeScript's Union Types!
13:45
The Most Important Design Pattern in React
35:04
Просмотров 32 тыс.
Dockerize Next.js & Deploy to VPS (EASY!)
19:43
Просмотров 58 тыс.
Replace Is Number Saves 440GB A WEEK
9:54
Просмотров 162 тыс.
Turns out REST APIs weren't the answer (and that's OK!)
10:38
Coding Was HARD Until I Learned These 5 Things...
8:34
This might change how we build UI forever
15:14
Просмотров 110 тыс.
КТО БОИТСЯ КЛЕЩЕЙ?? #shorts
00:18
Просмотров 2,1 млн