🐳 Build a Tiny Flask Web App in Docker (with Ports)

docker run -p 8080:5000 flask-hello

Then open in your browser: http://localhost:8080

Step 6: Stop the container

Press Ctrl + C in the terminal.

Quick Troubleshooting

  • Browser says “This site can’t be reached”: Make sure the container is running and you used the -p port mapping.
  • Flask runs but not accessible: Confirm Flask is running with host="0.0.0.0" inside Docker (not 127.0.0.1).
  • Port already in use: Try using a different host port, for example:
    docker run -p 9090:5000 flask-hello

Next Post Ideas

  • Docker image layers and caching (explained simply)
  • Docker volumes: keeping data after a container stops
  • Running the same container in Kubernetes (Pod basics)

Popular posts from this blog

☁️ AWS Global Accelerator (GA) + Route 53

🐳 Docker Filesystem Internals (AdvancEd)

Understanding RabbitMQ Classic Mirrored Queues and Quorum Queues

🐳 Docker Tutorial for Beginners: Step-by-Step with a Simple Example

☸️What’s Inside EKS? A Beginner’s Guide to Its Core Components

☸️ Kubernetes Taints and Tolerations(with Node Affinity)

AWS Load Balancer Controller Upgrade Guide: v2.x to v3.3

☁️ Amazon S3 Explained: More Than Just Object Storage

☸️ CoreDNS and AWS VPC CNI in EKS