Docker | How to Dockerize a React application (Beginners Guide)

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

Very Academy

Very Academy

Күн бұрын

This is a docker tutorial for beginners. Take your first steps with Docker containers with React. In this tutorial we are going to Dockerize a React application as a complete beginner to Docker. We first Create a new React application then Prepare a React app for Docker building a Dockerfile. A Dockerfile is a text document that contains all the commands a user could call on the command line to assemble an image. Now we go ahead and Build a Docker image and then finally Start a new Docker container to display React running in our container.
######
Spot the mistake?
Is Alpine a slim image?
What is the difference between Alpine and Buster? 👍
######
00:00 Introduction and underpinning knowledge
Code Repository:
github.com/ver...
🐱‍🏍Would you like to SUPPORT US FURTHER so that we can make even more great content - Please consider joining our members community.
/ @veryacademy
👍SUBSCRIBE to get more free tutorials, courses and code snippets!
/ @veryacademy

Пікірлер: 65
@pgallovich
@pgallovich 3 жыл бұрын
This series keeps getting better and better. I love this channel. Learning so much and exactly what I needed for Docker. Thank you!
@veryacademy
@veryacademy 3 жыл бұрын
You're very welcome! I will keep it coming.
@georgiod9
@georgiod9 2 жыл бұрын
This is all i can ask for, very concise, clear and straight to the point. Solved all of my issues, thanks.
@SoloPython
@SoloPython 3 жыл бұрын
I see a angel among us! Thank you so much zander!!
@veryacademy
@veryacademy 3 жыл бұрын
👍
@rangabharath4253
@rangabharath4253 3 жыл бұрын
Congratulations on 10k subscribers. More to come 👍 🎉🥳
@veryacademy
@veryacademy 3 жыл бұрын
Thank you so much 🤗
@siyayat
@siyayat 3 жыл бұрын
Waiting for next Django and React tutorial 👍👍👍
@austonlim5836
@austonlim5836 2 жыл бұрын
This tutorial is great! Straight to the point, no fluff!
@ahmedabdelgawad2684
@ahmedabdelgawad2684 Жыл бұрын
Loved every lesson I've watched so far.
@Peamceout
@Peamceout 3 жыл бұрын
The way you taught this was very easy. Thanks for this.
@veryacademy
@veryacademy 3 жыл бұрын
Glad it was helpful!
@PraisPranav
@PraisPranav 3 жыл бұрын
I fed up trying... Your video was too helpful.. it will help me in next assignment
@veryacademy
@veryacademy 3 жыл бұрын
All the best
@muhannadalulaby8727
@muhannadalulaby8727 9 ай бұрын
Thank you so much for such a great and amazing tutoril. Just one question here which is, how can one have the setup in a way where it is possible to continue developing and working from within the docker container? So accessing the requirements and the rest of the setuo can still be posdible?
@fatemazohra8354
@fatemazohra8354 3 жыл бұрын
Awesome as always, zander!!
@veryacademy
@veryacademy 3 жыл бұрын
Thanks again!
@ipdmartins
@ipdmartins 2 жыл бұрын
Thank you, it worked perfectly for me.
@adriangonzalez7857
@adriangonzalez7857 3 жыл бұрын
Awesome channel dude
@veryacademy
@veryacademy 3 жыл бұрын
Hey, thanks!
@rangabharath4253
@rangabharath4253 3 жыл бұрын
Awesome as always 👍😀
@veryacademy
@veryacademy 3 жыл бұрын
Thanks again!
@fabiangctube
@fabiangctube Жыл бұрын
Hi, can the port mapping be done without the compose file? Is the docker compose mandatory if I have only the react app to expose?
@sagarkudu3123
@sagarkudu3123 2 жыл бұрын
Thanks!!!
@TreeLuvBurdpu
@TreeLuvBurdpu 2 жыл бұрын
Very good. You give a hint at adding a node_modules cache, but no clue how to start?
@giannifed
@giannifed 3 жыл бұрын
thank you sir.
@veryacademy
@veryacademy 3 жыл бұрын
Most welcome
@matiasalvarez6533
@matiasalvarez6533 2 жыл бұрын
Why not copying only the build files?
@veryacademy
@veryacademy 2 жыл бұрын
No particular reason. This is just working towards the idea of containing React
@jasonhuang4333
@jasonhuang4333 2 жыл бұрын
Should we add .dockerignore file to ignore node_modules ?
@akhillshetty4082
@akhillshetty4082 3 жыл бұрын
Zander!! Can you combine this with containerized Django backend and React Frontend?
@veryacademy
@veryacademy 3 жыл бұрын
Up next
@nileshnayak5291
@nileshnayak5291 2 жыл бұрын
I am getting a node_modules/.bin not found error .. any idea
@nguyensam8288
@nguyensam8288 3 жыл бұрын
I don't quite understand, I think docker will help us not to prepare the environment to be able to write code, like in the video you have to install node to be able to use npm, so what does docker mean in this case? ?
@veryacademy
@veryacademy 3 жыл бұрын
Hi Nguyen, sorry for the confusion, I made this as a first look at how to use docker with react, thinking about starting to prepare react for deploying or running a react app in docker. I made it this way also as it was a request from a community member.
@nguyensam8288
@nguyensam8288 3 жыл бұрын
@@veryacademy It seems like every tutorial on the net has a react project available but it doesn't say how it was created when the os doesn't have node js. Can you make a video to show how to create a react project with a node image?
@veryacademy
@veryacademy 3 жыл бұрын
So to confirm, you want to develop react in a docker container so that you don’t need to install node on your machine?
@nguyensam8288
@nguyensam8288 3 жыл бұрын
@@veryacademy Yes sir, is that posible?? Cuz im try a hole day but still not get any result. It seem my request only fit with new member join a team, but not the one create react app. Im try to pull a node image and build a container from it. And i fail in step 2.
@veryacademy
@veryacademy 3 жыл бұрын
You can build a react app without node, but you will need node resources to run and package react. Building it in a docker container is possible but, is there any reason why you can’t install node?
@MarkAlterBridge
@MarkAlterBridge 3 жыл бұрын
I'm having issues getting the container to bind the port (localhost:3000 isn't available) even when using -it and doing npm start i can see it started up fine. I tried turning off windows firewall but no difference, any ideas of some steps to take around windows 10 docker + port forwarding? Also trying to understand why you use 'RUN npm run build' vs 'RUN npm install' surely the CMD npm start isn't making any use of the CRA build output within the container?
@veryacademy
@veryacademy 3 жыл бұрын
npm install: installs dependencies, then calls the install from the package.json scripts field. npm run build: runs the build field from the package.json scripts field.
@sanjamsinghkalsi5937
@sanjamsinghkalsi5937 3 жыл бұрын
Hi there! first of all thanks for the video..just a small query, the error at 16:01 how can we fix this error?
@veryacademy
@veryacademy 3 жыл бұрын
Had a quick look - not sure...
@lorenzonannini1685
@lorenzonannini1685 2 жыл бұрын
npm not installed. Why?
@hasibuzzamantonmoy8845
@hasibuzzamantonmoy8845 3 жыл бұрын
First!
@oauth9728
@oauth9728 3 жыл бұрын
Seconded! No doubt the content always super. Happy viewing. Yet to subscribe? You're missing
@veryacademy
@veryacademy 3 жыл бұрын
Love the dedication - thank you!
@ErikBurdett
@ErikBurdett 3 жыл бұрын
Hi Zander, this is a great video and really helped me with a project. I'm on to setting up a git actions CI pipeline that I need a Docker container to run a command with - Do you have any videos or resources you could point me towards?
@pawnstar8771
@pawnstar8771 2 жыл бұрын
Hey thanks for the video. I have a problem though- When I make change in App.js in react it does not reflect on localhost. Can you please help
@dima6488
@dima6488 2 жыл бұрын
Look up docker volumes
@pawnstar8771
@pawnstar8771 2 жыл бұрын
@@dima6488 I am no more a frontend dev now 😂
@dima6488
@dima6488 2 жыл бұрын
@@pawnstar8771 Figured I'm probably late to the party but posted for anyone else in the future :)
@sunnypepple6571
@sunnypepple6571 3 жыл бұрын
it appears this is for production
@veryacademy
@veryacademy 3 жыл бұрын
Just a bit of pointing in the right direction 👍
@debugpro
@debugpro 2 жыл бұрын
your voice is so low
Docker | Towards serving React (Nginx) with Django API (gunicorn)
48:35
Docker | How to Dockerize a Django application (Beginners Guide)
20:08
Players vs Corner Flags 🤯
00:28
LE FOOT EN VIDÉO
Рет қаралды 57 МЛН
Electric Flying Bird with Hanging Wire Automatic for Ceiling Parrot
00:15
Learn Docker in 1 Hour | Full Docker Course for Beginners
1:27:53
JavaScript Mastery
Рет қаралды 339 М.
How to create a great dev environment with Docker
29:55
Patrick Loeber
Рет қаралды 265 М.
Using docker in unusual ways
12:58
Dreams of Code
Рет қаралды 448 М.
Building a Django Docker Container
34:11
Very Academy
Рет қаралды 25 М.
Players vs Corner Flags 🤯
00:28
LE FOOT EN VIDÉO
Рет қаралды 57 МЛН