Building and deploying Next.js applications with Docker

Ғылым және технология

Did you miss the Docker Community All-Hands on March 31st, 2022?
Here is a replay of the talk hosted by Armagan Amcalar (@dashersw): Building and deploying Next.js applications with Docker.
► Description: Next.js is a popular choice when it comes to building server-side rendered frontend applications with React. With static site generation and an extensive suite of development tools, Next.js offers an end-to-end solution. In this talk, Armagan will go over the steps you need to follow to use Next.js in Docker to enable a consistent development and deployment experience, including the development of Docker images for local application development and highly optimized production Docker images for deployment.
🐳 Join our community on Slack: dockr.ly/slack
You can follow Docker on social networks:
► Twitter: / docker
► LinkedIn: / docker
► Facebook: / docker.run

Пікірлер: 43

  • @iuripires7285
    @iuripires7285 Жыл бұрын

    Very very good! Thank you so much! Very didact and detailed. I've learned a lot!

  • @lorenzocodes
    @lorenzocodes Жыл бұрын

    Precise and concise explanation... Thank you very much.

  • @imjavierpalma
    @imjavierpalma2 жыл бұрын

    Informative and clear! Cheers!

  • @user-gs9oh5lq2k
    @user-gs9oh5lq2k Жыл бұрын

    Thank you! It was very helpful and I like the way you teach!

  • @simonjanca
    @simonjanca2 жыл бұрын

    Hi. It was really the best video I saw for that matter in last time. Thanks :)

  • @deniz-ozkan
    @deniz-ozkan2 жыл бұрын

    Thank you for this amazing presentation, pretty concise and informative! 🎉

  • @MateuszKrysiak-vv4tp
    @MateuszKrysiak-vv4tp Жыл бұрын

    Amazing! Finally I know what am I doing! Very important for me was to watch that video to the end, where u explain Dockerfile from NextJS documentation ;))

  • @ElOculto2d
    @ElOculto2d10 ай бұрын

    Thank you for the video, very didatic and detailed, nice concepts and informative contents for us. Really really good!

  • @thinhbui4835
    @thinhbui48352 жыл бұрын

    Thank you sir, just another question, how do I config to change default port 3000 to 4200 of the container? Do I need to create a server.js file?

  • @bibblebabl
    @bibblebabl2 жыл бұрын

    It would be nice to have source code as well 🙂

  • @pedropcamellon
    @pedropcamellon3 ай бұрын

    Informative and concise. Loved it! :) thanks!

  • @milenkomarkovic
    @milenkomarkovic2 жыл бұрын

    Fantastic work!

  • @riansyahtohamba8215
    @riansyahtohamba8215 Жыл бұрын

    thanks for the videos guys

  • @Basil_Porphyrogenitos
    @Basil_Porphyrogenitos2 жыл бұрын

    Thanks a lot for this man

  • @bibblebabl
    @bibblebabl2 жыл бұрын

    Thanks. What if we want to use it with nginx?

  • @Rafael-vn2bo
    @Rafael-vn2bo Жыл бұрын

    Thanks, worked for me.

  • @antoniofabricio9276
    @antoniofabricio92762 жыл бұрын

    how do i build and deploy a next js with node app with docker?

  • @phulesudarshan
    @phulesudarshan Жыл бұрын

    Do we have a video for next steps to take this to next level on aws for prod as well?

  • @anandhukraju8044
    @anandhukraju80442 жыл бұрын

    Does the Nextjs Image component run well on prod?

  • @user-wo2jn1fb9k
    @user-wo2jn1fb9k Жыл бұрын

    Hi Armagan! Thank you for this amazing presentation! When use command docker-compose -f docker-compose.production.yml up --build --force-recreate I get errors in my application that are not present when building locally: 1. Type error: Cannot find module '../components/Heading' or its corresponding type declarations. #0 8.843 > 4 | import Heading from "../components/Heading"; 2. failed to solve: executor failed running [/bin/sh -c npm run build]: exit code: 1 Please tell me how to fix it?

  • @thatsalot3577

    @thatsalot3577

    Жыл бұрын

    It happened because you didn't copied the components folder which has a file Heading, But you imported this file in your pages folder If you're creating a components folder make sure to copy it in the dockerfile just like you copied pages folder. COPY components ./components

  • @stefanflaschko
    @stefanflaschko5 ай бұрын

    Where is the deploying part? localhost is not deployment.

  • @nileshchaudhari843
    @nileshchaudhari8432 жыл бұрын

    Hi Armagan, when use command docker-compose -f docker-compose.production.yml up --build --force-recreate ERROR: The Compose file is invalid because: Service app has neither an image nor a build context specified. At least one must be provided.

  • @jowarren7211

    @jowarren7211

    2 жыл бұрын

    I ran into this too and added "context: . " in the compose under the build field

  • @nileshchaudhari843

    @nileshchaudhari843

    2 жыл бұрын

    @@jowarren7211 Thanks it works

  • @marceloguimaraes796
    @marceloguimaraes7962 жыл бұрын

    In development ssr no work, getServerSideProps :(

  • @onurkantar4307
    @onurkantar43077 ай бұрын

    Bir kere daha astık bayrakları 😇 Eline sağlık Armağan!

  • @wchorski
    @wchorski Жыл бұрын

    links to source code or snippit you copy pasted?

  • @rickvianaldi7620
    @rickvianaldi76202 жыл бұрын

    8:01 i was surprised on the text can change suddenly, it seems like you edit and save on the other screen?

  • @raajnadar

    @raajnadar

    2 жыл бұрын

    Hot reloading

  • @lxttledemonking
    @lxttledemonking2 жыл бұрын

    if you're using typescript consider removing the NODE_ENV=production from the first stage of Dockerfile.production

  • @jeffinj7707

    @jeffinj7707

    2 жыл бұрын

    can you share why? thanks

  • @peterdshekiondo9444

    @peterdshekiondo9444

    Жыл бұрын

    am not sure why but in my initial build, the site was rendering a blank page. But this resolved it.

  • @RaducuGabriel
    @RaducuGabriel2 жыл бұрын

    sorry, but where is the deploying part?

  • @chrisauret3785
    @chrisauret37852 жыл бұрын

    Yes but How do we run in different environments? Say Dev, STG, QA, Prod, where each environment needs its own config variables? Can we use one image for each different environment? (and how do we configure the envionment variables to use to use with this approach) Or do we need to build a seperate image for each environment? (and how do we configure the envionment variables to use with this approach)

  • @secret-alias

    @secret-alias

    2 жыл бұрын

    I'm no expert but I would imagine in your CI/CD process, when you run docker build you could pass in your variables to either run a different build if that's what you need, or to build once and use the variables if they don't affect the build if that's what you need. I think that's entirely down to your own requirements. If it affects the build, then different images, if not, then just pass the variables straight through to the application.

  • @iamrajesh1980
    @iamrajesh1980 Жыл бұрын

    Can you please post the source to GitHub

  • @en_kratia

    @en_kratia

    8 ай бұрын

    Link in the end of the video?

  • @theouerd
    @theouerd Жыл бұрын

    there’s a famous quote that says : talk is cheap, show me the code 😅

  • @tannedstone3736
    @tannedstone3736 Жыл бұрын

    13:33

  • @thehaptiK
    @thehaptiK2 жыл бұрын

    these presentations are useless without submitting your code to a public repo

  • @batm1x
    @batm1x Жыл бұрын

    Why do you have install additional package "yarn", if you have already installed npm with node by default? What the point ?

  • @ryostyles9904

    @ryostyles9904

    7 ай бұрын

    Yarn is basically faster than npm, so a lot of people prefer yarn. It's quite like how a lot of people use axio instead of the built in fetch api

Келесі