Sign inSign up

vlauciani/ws-icon

By vlauciani

•Updated 10 months ago

Docker container for generating customizable icon images

Image
0

1.7K

vlauciani/ws-icon repository overview

License GitHub issues Docker Pulls CI

⁠ws-icon

A lightweight web service for generating customizable icon images in various shapes (circle, square, triangle, pentagon, hexagon, star) with PNG output.

⁠Quick Start

docker pull vlauciani/ws-icon:latest
docker run -d --rm -p 8999:80 --name ws-icon vlauciani/ws-icon:latest

Access the service at:

⁠Build Yourself
git clone https://github.com/vlauciani/ws-icon.git
cd ws-icon
docker build -t vlauciani/ws-icon:latest .
docker run -d --rm -p 8999:80 --name ws-icon vlauciani/ws-icon:latest

⁠Supported Icon Types

TypeDescription
circleCircular icons
squareSquare icons with border
triangleTriangular icons
pentagonPentagon icons
hexagonHexagon icons
star5-pointed star icons

⁠Environment Variables

VariableDefaultDescription
LOG_ENABLEDfalseEnable/disable logging
LOG_TO_STDOUTtrueOutput logs to stdout (works only if LOG_ENABLED=true)
LOG_FILE/tmp/log/YYYY-MM-DD__ws_icon.logLog file path (when LOG_TO_STDOUT=false)

Example with logging:

docker run -d --rm -p 8999:80 \
  -e LOG_ENABLED=true \
  -e LOG_TO_STDOUT=true \
  --name ws-icon \
  vlauciani/ws-icon:latest

If you set LOG_ENABLED=true and LOG_TO_STDOUT=false and you want to view your log files outside the container, create log directory with full permissions:

mkdir /tmp/log
chmod 777 /tmp/log/

and mount it with: -v /tmp/log:/tmp/log. Example:

docker run -d --rm -p 8999:80 \
    -e LOG_ENABLED=true \
    -e LOG_TO_STDOUT=false \
    -v /tmp/log:/tmp/log \
    vlauciani/ws-icon:latest

⁠Key Features

  • Multi-shape support: Circle, square, triangle, pentagon, hexagon, star
  • Customizable: Colors, labels, borders, font sizes
  • Validation: Input validation with detailed error messages (JSON format)
  • Caching: Aggressive caching (1 year) for optimal performance
  • CORS enabled: Ready for browser-based applications
  • Health monitoring: Built-in health check endpoint
  • Swagger UI: Interactive API documentation
⁠Validation Limits
  • Hex colors: 6-digit hexadecimal (e.g., FF0000)
  • Circle radius: 10-500 pixels
  • Font size: 6-72 points
  • Border size: 0-10 pixels
  • Label: 1-10 characters

⁠Development

Run with live reload:

docker build -t vlauciani/ws-icon:latest .
docker run --rm -p 8999:80 \
  -e LOG_ENABLED=true \
  -e LOG_TO_STDOUT=true \
  -v $(pwd):/app \
  -v $(pwd)/log:/tmp/log \
  --name ws-icon \
  vlauciani/ws-icon:latest

⁠API Documentation

Full interactive API documentation is available at: http://localhost:8999/⁠

The legacy Swagger endpoint is still accessible at: http://localhost:8999/swagger/⁠

⁠Contribute

Contributions are welcome! See the list of contributors:

⁠

⁠License

MIT License⁠ - Copyright (c) 2025 Valentino Lauciani

⁠Author

Valentino Lauciani - vlauciani[at]gmail.com

Tag summary

Content type

Image

Digest

sha256:6c6d171d8…

Size

403.5 MB

Last updated

10 months ago

docker pull vlauciani/ws-icon