This is a minimal Flask Hey There Python application running inside a Docker container.
The application exposes a single endpoint that returns a JSON message.
. βββ index.py βββ requirements.txt βββ Dockerfile βββ README.md
The Flask app runs on port 3000 and returns the following response on /:
{"message":"Hey There Python"}
π How to Run Using Docker
πΉ Build Docker Image
docker build -t rahulrokksss/python-flask:0.0.1.RELEASE .
πΉ Run Docker Container
docker run -d -p 4000:3000 rahulrokksss/python-flask:0.0.
1.RELEASE
πΉ Access the Application
Open your browser or use curl:
http://localhost:4000
π³ Docker Hub Image
The image is available on Docker Hub:
rahulrokksss/python-flask:0.0.1.RELEASE
π Tech Stack
Python
Flask
Docker
β
Output Example
{"message":"Hey There Python"}
π Notes
Flask runs on 0.0.0.0 to allow external access from Docker
Port 3000 is exposed inside the container
Port 4000 is used on the host machine
β¨ Author
Rahul Shukla