Skip to content

ovis22/docker-quotes

Repository files navigation

Dockerized ASCII Quote Generators: Optimized Multi-Variant Collection

Star Wars & Polish-Music inspired quotes rendered with FIGlet on Alpine Linux.

Build Status Last Commit Image Size Security License: MIT

Docker Docker Compose Alpine Linux Bash Python Lolcat GitHub Actions

A collection of containerized quote generators focused on Docker best practices. Features include a 64% footprint reduction via Alpine Linux, enhanced security through non-root execution, and a universal image architecture configurable via environment variables.

Star Wars Quote Demo

πŸ“” Table of Contents

🌟 About the Project

Tech Stack

🎯 Features

  • Universal Image Architecture: One generic Dockerfile powers all services. Logic is handled via environment variables.
  • Lightweight: Base Alpine image reduces footprint by ~90% (Bash-only) or ~64% (Hybrid Python) compared to standard Ubuntu images.
  • Security: Runs as a non-root user (appuser) for enhanced isolation.
  • Orchestrated Sequence: Uses docker-compose dependencies to ensure logs print sequentially (Default -> Star Wars -> Polish Songs) without overlap.
  • Automated CI/CD: GitHub Actions workflow builds and verifies the image on every push (Multi-Arch).
  • Dynamic Fonts: Dockerfile downloads multiple FIGlet fonts (starwars, Doom) in a single optimized layer.
  • Rainbow Output: Automatic colorization via lolcat for a vibrant terminal experience.
  • Multi-Architecture: Native compatibility for amd64 and arm64 (Apple Silicon/Intel/AMD).

πŸ“ˆ Optimization Results

Variant Environment Image Size Reduction vs Ubuntu
Original Ubuntu (Default) 223 MB -
Optimized Alpine (Bash only) ~22 MB ~90% reduction
Current (v1.1.0) Alpine (Hybrid + Python + Lolcat) ~80 MB ~64% reduction

Note: The current image includes Python runtime support, increasing size from ~22MB to ~80MB, but enabling advanced scripting logic while remaining significantly smaller than standard images.

βš™οΈ How it Works

The project uses a single image (docker-quotes:v1.1.0) instantiated 3 times with different configurations.

1. The Configuration

Each container is customized via docker-compose.yml:

environment:
  - QUOTES=Quote 1;Quote 2;Quote 3  # Semicolon separated
  - FONT_NAME=starwars              # Matches filenames in /usr/share/figlet/
  - APP_MODE=python                 # Options: 'bash' (default) or 'python'

2. The Sequence

To keep the terminal output clean, services are chained using depends_on:

  1. app-default (Starts first)
  2. app-starwars (Waits for default)
  3. app-polish-songs (Waits for starwars)

🧰 Getting Started

‼️ Prerequisites

  • Docker installed on your machine. Here
  • System: Compatible with linux/amd64 (Intel/AMD) and linux/arm64 (Apple Silicon/RPi).
docker --version

βš™οΈ Installation

Clone the repository:

git clone https://github.com/ovis22/docker-quotes.git
cd docker-quotes

πŸƒ Run Locally

  1. Build and run all variants using Docker Compose:
docker-compose up --build

(Note: Using --build ensures any cached font layers are updated)

  1. Watch the logs for random quotes from:

    • quotes-default (Standard font)
    • quotes-starwars (Star Wars font)
    • quotes-polish-songs (Doom font - Polish Music Classics)
  2. The containers will exit automatically after printing the message.

🎩 Manual Mode Selection

You can choose between the Bash and Python execution engines using the APP_MODE environment variable.

Run with Python:

docker run --rm -e APP_MODE=python ovis22/docker-quotes:v1.1.0

Run with Bash (Default):

docker run --rm ovis22/docker-quotes:v1.1.0

🧭 Roadmap

  • Create Star Wars variant
  • Create Polish songs inspired variant
  • Migrate to Alpine Linux (90% size reduction)
  • Implement non-root user security (appuser)
  • Refactor to Single Universal Dockerfile
  • Implement Docker Compose orchestration (Sequential)
  • Add GitHub Actions CI/CD pipeline
  • Add demo screenshot
  • Add more quotes and variants
  • Implement Hybrid Architecture (Bash + Python support)
  • Add lolcat colorization
  • Support Multi-Architecture builds (amd64/arm64)

πŸ‘‹ Contributing

Contributions are always welcome!

Feel free to open an issue or submit a pull request.

❔ FAQ

  • Do I need anything other than Docker to run this project?
    No. As long as you have Docker installed, you can build and run all variants locally.

  • How do I add my own quote variant?
    Add a new service to docker-compose.yml, specifying the QUOTES environment variable (semicolon-separated) and FONT_NAME (e.g., standard, starwars, Doom). No new directories needed!

⚠️ License

Distributed under the MIT License. See the LICENSE file for more information.

🀝 Contact

ovis22 – kharoof.ovis@gmail.com

Professional Contact & Job Offers - Contact

Project Link: https://github.com/ovis22/docker-quotes

πŸ’Ž Acknowledgements

About

Lightweight (Alpine-based) Dockerized ASCII quote generator featuring non-root security, automated CI/CD via GitHub Actions, and orchestrated sequential logging with Docker Compose.

Topics

Resources

License

Stars

Watchers

Forks

Contributors