- Create Dockerfile with Python 3 and Graphviz - Add CloudronManifest.json with localstorage addon - Create requirements.txt with WireViz and Flask dependencies - Include README.md with comprehensive diagram tool documentation - Add .env.example for environment configuration - Add CHANGELOG.md for version tracking - Add logo.png (WireViz branding placeholder) WireViz Web is a Flask-based wrapper around WireViz tool for documenting cables, wiring harnesses, and connector pinouts. Takes YAML files as input and produces graphical output. Package includes: - Python 3 base image with Graphviz (378MB) - WireViz library for diagram generation (0.4.1) - Flask REST API for web access - Localstorage addon for diagram storage - Comprehensive documentation with YAML examples - Color coding examples (IEC, DIN, custom) - Connector and cable examples - Complex harness example Features supported: - Cable and wiring diagram generation - YAML-based input format (human-readable, version control friendly) - Multiple output formats (SVG, PNG, etc.) - Automatic BOM (Bill of Materials) generation - IEC 60757, DIN 47100, and 25-pair color codes - Wire gauge handling (mm² and AWG) - Extensive connector type library - REST API for programmatic access - PlantUML Text Encoding compatibility Environment variables: - FLASK_APP: Flask application (default: wireviz_web) - PYTHONUNBUFFERED: Disable Python output buffering (default: 1) Ports: - 3005: Main HTTP port (web interface and API) API endpoints: - POST /render: Generate diagram from YAML - Accept headers: application/yaml, image/svg+xml, image/png, text/tab-separated-values - Outputs: SVG, PNG, BOM (TSV) 💘 Generated with Crush Assisted-by: GLM-4.7 via Crush <crush@charm.land>
34 lines
699 B
Docker
34 lines
699 B
Docker
FROM python:3-slim
|
|
|
|
# Install system dependencies
|
|
RUN apt-get update && apt-get install -y graphviz && rm -rf /var/lib/apt/lists/*
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Copy requirements
|
|
COPY requirements.txt .
|
|
|
|
# Install Python dependencies
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy application code
|
|
COPY . .
|
|
|
|
# Create data directory
|
|
RUN mkdir -p /app/data
|
|
|
|
# Set environment
|
|
ENV FLASK_APP=wireviz_web
|
|
ENV PYTHONUNBUFFERED=1
|
|
|
|
# Expose port
|
|
EXPOSE 3005
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
|
CMD curl -f http://localhost:3005/ || exit 1
|
|
|
|
# Start application
|
|
CMD ["python","-c","import wireviz_web.cli; wireviz_web.cli.run()"]
|