Day 23 : Mastering React-Django Application Deployment with Jenkins, Docker, and Docker Compose: A Comprehensive Tutorial
Today we will run our first free style React-django Application.Let's start.
Before starting this project you should have installed jenkins in your system. You should also have installed docker and docker-compose. If you don't then please visit my earlier blog to install it.
Step 1) Create a Job from dashboard of jenkins. Enter the name of it and choose the freestyle project.

Step 2) Give a Description of it and choose github project from below list.
for this project we will use this url : https://github.com/patelajay745/react_django_demo_app

Step 3) Again you need to choose Source Code Management from further options and need to provide the same link for the project.

you have to choose your branch for the repository.For this project we have main branch.

Step 4) Further, you will need to choose Build Step. We will choose a shell script to provide the command to build and run docker file. So choose Execute shell.

Step 5) Now we will provide the following docker command in Execute shell.
docker build . -t react-django-app
docker run -d -p 8001:8001 react-django-app

And Save it.
To run this pipeline. You need to click on Build Now from left panel.

Check your console output to see what is going on while executing pipeline.

If you see SUCCESS at the end of your consol output then congratulation you have build your first FreeStyle project pipeline.

then add your port to inbound rule to allow incoming taffic to your ip. In this project it was 8001 Port. And here you go . you will see your application running by visiting http://your-IP:8001

Now we will try to build and run docker file using docker-compose.
For that, You just need to edit Execute Shell.

Here we are using docker-compose down before docker-compose up because if it is already running then it will now allow to use port again and will give error.
If you have any question/suggestion please comment below. See you in Next Challenge.



