Webserver using docker, Flask and Python code

Webserver using docker, Flask and Python code

image taken from net

This is for the docker project of the IIEC RISE docker campaign

The one and only teacher #vimaldaga sir has taught very well so i became able to do this .

This is used for running web page in your own customized image of Docker. this may help those who want to quickly run their website on their host pc and if website goes down by any reason then the whole set up will not have to set again just run the image on same port and your website will run again in few second in this era no any customer wants Latency and here this can help a lot ..

Now this project is for running a webpage from flask webserver.

Project github link is here:

https://github.com/ashu-cybertron/docker-project

The docker hub link of the image which is already done with these steps is

https://hub.docker.com/repository/docker/ashucybertron/webflask

or you can pull image directly by using the command from your base OS:

docker pull ashucybertron/webflask

The Steps are written as follows

first:

docker run -it -p 5500:5000 --name webflask alpine

second:

apk add python py-virtualenv

3rd —

cd home

4th —

mkdir workdir

5th —

cd workdir

6th —

vi app.py

7th —

mkdir templates

8th —

cd templates

9th —

vi AshuWb.html

10th —

mkdir static

11th —

cd static

12th —

mkdir css images

13th —

cd css

14th —

touch style.css style2.css

15th —

cd ..

16th —

cd images

17th — i copied all the usable images here in images folder

18th —

cd /home/workdir

19th —

virtualenv ashuenv

20th —

pip install flask

21th —

python app.py

22th — goto web browser write url http://0.0.0.0/5500 now your website running…

for the codes you should view my github page .

Or you can easily do this by pulling my created image from docker hub ..

By “docker pull ashucybertron/webflask:v1”

And run with this command “docker run -it -p 5500:5000 — name webflask ashucybertron/webflask:v1”

Now you are ready to host your own website locally

i thank to vimal sir who taught to think like this and create something …

Comments

Popular posts from this blog

Name.com with Github in 2 steps

Integration of Github, Jenkins, and Docker

THE INTEGRATION OF GITHUB,DOCKER, AND JENKINS