Sign inSign up

muneebrather/mood-lamp

By muneebrather

Updated 2 months ago

Interactive container resilience demo: watch health degrade, crash, and auto-recover.

Image
Developer tools
Monitoring & observability
0

166

muneebrather/mood-lamp repository overview

Mood Lamp is a lightweight Flask application built to demonstrate how Docker health checks and restart policies work together.

How it works

  • Start the application and select the "Angry" mood.
  • After 15 seconds, Docker marks the container as unhealthy.
  • After 25 seconds, the application exits intentionally, causing the container to stop.
  • Docker automatically restarts the container using the --restart=on-failure policy.
  • The application starts again in the default "Calm" state.

Docker Concepts Demonstrated

  • Docker HEALTHCHECK
  • Restart policies (--restart=on-failure)
  • Container health monitoring
  • Automatic container recovery
  • Process exit codes and container lifecycle

Tech Stack

  • Python 3.11
  • Flask
  • Docker

USAGE:

Run the container:
docker run -d 
  --name lamp \
  --restart=on-failure \
  -p 5000:5000 \
  muneebrather/mood-lamp:latest

Author

Muneeb Ahmad Rather

Tag summary

Content type

Image

Digest

sha256:e405fb793

Size

48.8 MB

Last updated

2 months ago

docker pull muneebrather/mood-lamp