Skip to content

srolin/docker-apache-flask

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-apache-flask

Dockerfile with related build files.
Builds a Docker container from Ubuntu 16.04 LTS official (https://hub.docker.com/_/ubuntu/), installs Apache, Python 2.7, Flask, and realted files, and sets-up up a demo "Hello Word" site running under the Flask microframework (/var/www/FlaskApp).

Quickstart:
Assumes you've already installed Docker (https://docs.docker.com/engine/installation/linux/ubuntu/)
"$ sudo docker pull nhsb1/docker-apache-flask"
"$ sudo docker run -d --name apache_flask --net=host nhsb1/docker-apache-flask

Find the IP address of your host:
"$ ip addr"

You should get something that looks like the below, if you bring up a web browser and point it at your host's IP address:

apacheflashrunning

Or To build it yourself:
Get the files contained in this repo, put them in one subdirectory, then built it and run it.

Get the raw files:
wget https://raw.githubusercontent.com/nhsb1/docker-apache-flask/master/Dockerfile
wget https://raw.githubusercontent.com/nhsb1/docker-apache-flask/master/FlaskApp.conf
wget https://raw.githubusercontent.com/nhsb1/docker-apache-flask/master/__init__.py
wget https://github.com/nhsb1/docker-apache-flask/raw/master/docker-entrypoint.sh
wget https://raw.githubusercontent.com/nhsb1/docker-apache-flask/master/flaskapp.wsgi

Build the container using the files you just downloaded locally:
sudo docker build -t yourdockerhubaccount/apache_flask .

Run the container you just built locally:
sudo docker run -d --name apache_flask -v /host_directory_to_mount_in_container:/path_tobe_mounted_in_container -net=host yourdockerhubaccount/apache_flask

Explanation of the run command:
Run the container with a short-name (apache_flask), detached (-d), mounting a directory (/host_directory_to_mount_in_container) from your host (the machine running docker), to a directory inside your container (/path_tobe_mounted_in_container), using the host's network adapter to expose the new site (--net=host), with the local build your just created (yourdockerhubaccount/apache_flask).

Now that you've got it built and running.
Do a "sudo docker ps" to show it, find the host's IP address ("ip addr") and try loading it in a web browser (http://ipaddressofyourhost), and you should see the "Hello World!" image that's embedded above.

About

Dockerfile and support files to build Flask demo site

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 89.0%
  • Shell 11.0%