I recently built a microservice that instantiates a custom web server for my applied cryptography course website. The service monitors a Git repository, verifies commit signatures, selectively compiles LaTeX documents, uploads the resulting objects to Tigris for permanence and globally cached distribution, and serves the resulting website, all running as a single Go binary inside an Alpine Linux container on Fly.io.
When new commits arrive, the service checks for a valid commit signature against pinned Ed25519 SSH public keys. If verification fails, the service refuses to process the changes, preventing unauthorized modifications from being deployed.
The monitoring system is smart about what it rebuilds. Instead of recompiling everything on each update, it examines which files changed and triggers only the necessary Make targets. This selective compilation significantly reduces build times. If I update a single problem set, only that document gets recompiled with Tectonic. Changes to the Makefile or miscellaneous files trigger a full rebuild to ensure consistency. The service also includes a safety mechanism to prevent concurrent builds. It checks if Tectonic or Git processes are running before starting a new update cycle.
Tectonic has been a game-changer for this project and how I can automate LaTeX material compilation generally. Unlike traditional LaTeX distributions that require gigabytes of packages and complex dependency management, Tectonic is a single self-contained Rust binary. This means I can add it to the container with a simple download, avoiding the bloat of shipping TeX Live or MiKTeX. The binary handles all package downloads on-demand and caches them locally, so the container stays lean while still having access to any CTAN package I need.
Fly.io has been perfect for this use case. The platform handles the container orchestration, automatic HTTPS, and global edge caching, leaving me to focus on the application logic. My microservice has been running reliably on Fly.io, automatically deploying course updates within a minute of pushing to the repository. The selective compilation keeps build times under 30 seconds for most updates, while SSH signature verification provides peace of mind about the integrity of deployed content.
The entire system is about 500 lines of Go code—small enough to understand completely, yet powerful enough to handle a production course website. You can see the results of this setup in action at my course’s website, where all the course materials are automatically compiled and deployed through this pipeline.