Docker + ReactJS tutorial: Development to Production workflow + multi-stage builds + docker compose
Video Statistics and Information
Channel: Sanjeev Thiyagarajan
Views: 16,994
Rating: 4.983027 out of 5
Keywords: docker, react, reactjs, programming, webdev, devops, development, javascript, container, build, compose, tutorial, beginner
Id: 3xDAU5cvi5E
Channel Id: undefined
Length: 85min 37sec (5137 seconds)
Published: Tue Mar 09 2021
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.
why use React inside a docker? I still can't find any reason why people do that. Can someone give me a good explanation?
Hey guys I made a video on how to run a react app in docker containers and how to build a development to production workflow using multi-stage builds and docker-compose.
00:00 Intro
00:12 Initialize React App
00:46 Building an Image with Dockerfile
12:56 Creating first container
14:20 Docker networking - forwarding ports
19:25 dockerignore files
24:07 Bind mounts to sync src code
35:22 Read only bind mounts
37:44 Environment variables
43:02 Docker Compose
58:15 Multi-stage Build for Production with NGINX
1:11:42 Development vs production workflow
1:22:57 docker build with --target flag
Great tutorial! What resources did you use to learn this stuff yourself? Was it mainly work experience, reading docs, or just trial/error?
Question: this docker setup allows you to launch the yarn -watch inside the container console and have browser automatic hot reload?
If is not clear (sorry, English isn't my first language), if I use this docker setup in local and I change a row in the code, it will be available on the browser without refreshing it?
This is my biggest problem when I build react+symfony apps using docker.
Thank you, this was interesting to watch.