0% found this document useful (0 votes)
77 views

Deploy React Django App Using Docker

The document outlines the steps to deploy a React and Django application using Docker on an AWS EC2 Ubuntu instance. It involves installing Docker on the server, building a Docker image from the Dockerfile, running the image as a container exposing port 8000, and verifying the application is accessible at the public IP address of the EC2 instance on port 8000. Logging and terminal access of the running container are also described.

Uploaded by

Swapnil Dhande
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
77 views

Deploy React Django App Using Docker

The document outlines the steps to deploy a React and Django application using Docker on an AWS EC2 Ubuntu instance. It involves installing Docker on the server, building a Docker image from the Dockerfile, running the image as a container exposing port 8000, and verifying the application is accessible at the public IP address of the EC2 instance on port 8000. Logging and terminal access of the running container are also described.

Uploaded by

Swapnil Dhande
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Deployment of react-django app using docker

Step: 1

Create AWS EC2 ubuntu instance and update it first

Step: 2

Install docker on server

Step: 3

Give user permission for docker commands by using following command

And reboot server by -$ sudo reboot

And reconnect it

Step: 4

Clone git repository code to server

https://github.com/LondheShubham153/react_django_demo_app.git

Step: 5

Remove Dockerfile and create new


Step: 6

After creation of dockerfile, build image from it

Step: 7

Run image to create container


Step: 8

Copy paste the public ip of ec2 instance to web browser with port numer 8000

And app is running on port 8000

Step: 9

To check logs of container

To enter into container terminal to see live log screen


All commands

sudo apt-get update

sudo apt-get install -y docker.io

sudo usermod -aG docker $USER

sudo reboot

docker –version

git clone https://github.com/LondheShubham153/react_django_demo_app.git

ls

cd react_django_demo_app/

rm Dockerfile

ls

vim Dockerfile

ls

cat Dockerfile

docker build . -t django-image

docker images

docker run -d --name django-ctnr -p 8000:8000 django-image

docker ps

docker logs <container-id>

docker attach <container-id>

You might also like