How faustedition/faust-gen-docker works
Project Type & Purpose
• This is a containerized, multi‐service system focused on:
• Building and serving a static “www” site (via Gradle + Docker multi‐stage).
• Running two Python microservices (macrogen & downloadserver) behind an Apache reverse proxy.
• Providing a workflow for building “old” versions of the site and tagging images.
High‐Level Architecture Components
a. Docker Build Pipeline (local or CI)
• Input: Git repo with submodules (downloadserver, macrogen), XSL scripts, Gradle build files.
• Dockerfile with multi‐stage targets:
• www (build static site via Gradle)
• www-old (inject old/1.0rc tree via build‐arg)
• macrogen & downloadserver production images (copy code + entrypoint + Gunicorn config).
b. Container Orchestration (docker-compose)
• compose.yaml defines three containers on a custom network:
1. apache – Reverse proxy (apache.conf) serving static “www” & routing API calls.
2. macrogen – Python/Gunicorn service for text‐generation endpoints.
3. downloadserver – Python/Gunicorn service serving download metadata.
c. Configuration & Secrets
• .env files in each service folder for environment variables.
• apache.conf for vhost routing.
• adjust-conf-files.xsl for any XML transformations at build time.
d. Data Artifacts & Volumes
• Static site tree served by Apache (built into the www image).
• downloads.json.gz for downloadserver to serve/calculate.
• macrogen.yaml, logging.yaml for macrogen service configuration.
Relationships & Data Flow
• Client HTTP(S) → Apache container →
• GET “/static” → serves built site files
• API calls “/api/gen” → proxies to macrogen (Gunicorn)
• API calls “/api/downloads” → proxies to downloadserver
• macrogen reads its config from mounted files & environment; responds JSON.
• downloadserver reads downloads.json.gz and env, responds file metadata.
Key Architectural Patterns & Principles
• Microservices: each Python service is isolated, has its own Docker context, config, entrypoint, Gunicorn.
• Reverse Proxy Pattern: Apache sits in front, handling SSL (if any), static assets, and routing to services.
• Multi‐Stage Docker Builds: separate build vs. run stages to produce lean final images.
• Configuration as Code: XSL for config patching, YAML for service config, .env for secrets.
Technologies & Frameworks
• Docker, Docker Compose, Docker Bake/HCL for build orchestration.
• Gradle (Kotlin DSL) for static site generation.
• Apache HTTPD for reverse proxy & static file serving.
• Python + Gunicorn for microservices.
• XSLT for config adjustments.