Configuring WebServer on Docker And Running Python Script on Top Of Docker
Hey guys hope you all are doing good today we will be going to see how to install docker and setup webserver and python shell on it.
To install docker use the below command
yum install docker -y
Once installation is done we have to start the service for that use the following command
systemctl start docker
systemctl enable docker
Once the service is enabled and started we are good to go
To check the stop container we use the following command
docker ps -a
To check the running container we use the following command
docker ps
To check downloaded images we use the following command
docker images
To download any docker image we use the following command
docker pull imagename:tag
In the above image, I have downloaded the centos version 7 image as shown below.
To run the docker container use the following command
docker run -it — — name( container name you want) image: tag
To run the docker container using patting use the following command
docker run -it -p hostposrt:containerport — — name( container name you want) image: tag
Once launched the container you have to download the httpd apache software as shown below in the image.
After installing go to /var/www/html and create your HTML pages in the you want.
Once done all the steps mentioned above go to your hostsystemip:hostportno as shown below.
To run python script on docker if you are using centos version 7 as I showed above you don't have to do anything python is pre-installed in this so you just have to make your script and run it as shown below.
Guys, here we come to the end of this blog I hope you all like it and found it informative.
Guys follow me for such amazing blogs and if have any review then please let me know I will keep those points in my mind next time while writing blogs. If want to read more such blog to know more about me here is my website link https://sites.google.com/view/adityvgupta/home.Guys Please do not hesitate to keep 👏👏👏👏👏 for it (An Open Secret: You can clap up to 50 times for a post, and the best part is, it wouldn’t cost you anything), also feel free to share it across. This really means a lot to me.