Sign inSign up

embarkx/hello-python

By embarkx

•Updated 10 months ago

A lightweight Python Flask application designed for Docker, Kubernetes, and DevOps learning.

Image
0

1.7K

embarkx/hello-python repository overview

⁠Hello Python – Production-Ready Flask Demo App

A lightweight Python Flask application designed for Docker, Kubernetes, and DevOps learning. This container returns runtime metadata such as environment variables and container hostname, making it ideal for teaching microservices, scaling, and container networking fundamentals.


⁠Available Tags

TagDescription
latestMost updated version
v1.0.0Stable release used in the course
stableSafest version for beginners

⁠Quick Start

Pull the image:

docker pull embarkx/hello-python:latest

Run the container:

docker run -p 3000:3000 embarkx/hello-python

Visit:

http://localhost:3000/⁠


⁠API Response Format

The root endpoint (/) returns JSON:

{
  "message": "Hello from Simple App (Python Flask)",
  "env": "<value of ENV_VALUE>",
  "container": "<container-hostname>"
}

This demonstrates:

  • Environment variable injection into containers
  • Metadata changing per container instance
  • Hostname behavior inside Docker and Kubernetes

⁠Environment Variables

VariableDefaultDescription
ENV_VALUENo env setCustom message from environment
PORT3000Port the application listens on

Example:

docker run -p 4000:4000 \
  -e PORT=4000 \
  -e ENV_VALUE="Running in Docker" \
  embarkx/hello-python

⁠Exposed Ports

3000

⁠Docker Compose Example

services:
  hello-python:
    image: embarkx/hello-python:stable
    ports:
      - "3000:3000"
    environment:
      ENV_VALUE: "Hello from Docker Compose"
      PORT: 3000

⁠Version History

  • v1.0.0 – Initial stable release
  • latest – Same as v1.0.0
  • stable – Recommended for learners

⁠Base Image Details

  • Base Image: python:3.10-slim
  • Framework: Flask
  • Dependencies installed using pip with no cache for smaller size
  • Application listens on 0.0.0.0 for container compatibility

⁠Advanced Run Options

Detached mode:

docker run -d -p 3000:3000 embarkx/hello-python

Change port:

docker run -p 5000:5000 \
  -e PORT=5000 \
  embarkx/hello-python

⁠Build Instructions

docker build -t embarkx/hello-python .

⁠Architectures

  • linux/amd64

Tag summary

Content type

Image

Digest

sha256:577328339…

Size

46.6 MB

Last updated

10 months ago

docker pull embarkx/hello-python