GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - lvthillo/python-flask-docker: Basic Python Flask app in Docker which prints the hostname and IP of the container

BranchesTags
Open more actions menu

Latest commit

 

History

50 Commits
50 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
src
src
 
 
.dockerignore
.dockerignore
 
 
.gitignore
.gitignore
 
 
Dockerfile
Dockerfile
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
requirements.txt
requirements.txt
 
 

Repository files navigation

lvthillo/python-flask-docker

Basic Python Flask app in Docker which prints the hostname and IP of the container

Docker Pulls License GitHub stars

About

Launches a Flask web server inside a Docker container. When you visit the page, it displays:

The hostname of the container is 6095273a4e9b and its IP is 172.17.0.2.

This confirms the container is running and shows key networking info -- useful for demos, testing, and learning Docker networking.

Quick Start

Prerequisites

  • Docker installed

Option 1: Pull from Docker Hub (fastest)

docker pull lvthillo/python-flask-docker
docker run -d -p 8080:8080 --name flask-demo lvthillo/python-flask-docker

Visit http://localhost:8080

Option 2: Build from source

git clone https://github.com/lvthillo/python-flask-docker.git
cd python-flask-docker
docker build -t lvthillo/python-flask-docker .
docker run -d -p 8080:8080 --name flask-demo lvthillo/python-flask-docker

Verify It's Running

# Check container IP
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' flask-demo

# Check container hostname
docker inspect -f '{{ .Config.Hostname }}' flask-demo

# View logs
docker logs flask-demo

Project Structure

python-flask-docker/
├── src/
│   └── app.py      # Flask application
├── Dockerfile       # Docker build instructions
├── requirements.txt # Python dependencies
└── README.md

Stop & Clean Up

docker stop flask-demo
docker rm flask-demo

License

MIT

About

Basic Python Flask app in Docker which prints the hostname and IP of the container

Topics

dockerpython-flask

Resources

Readme
MIT license
Activity

Stars

79 stars

Watchers

3 watching

Forks

352 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.