Static Sites with Python, uv, Caddy, and Docker
2 days ago
- #Python
- #Docker
- #Static Sites
- The author has switched to using 'uv' for Python development, praising its speed and workflow efficiency.
- They utilize a multi-stage Docker build with Caddy for serving static sites, including a URL shortener named 'sus'.
- The Dockerfile starts with a Debian-based image containing 'uv', sets a working directory, and copies project files.
- Python is installed via 'uv', and the build process is executed with 'uv run', skipping development dependencies.
- The static site is built in '/src/output' and then served using Caddy in a separate Alpine-based image.
- The Caddy configuration includes domain settings, file serving directives, and a reverse proxy for Plausible Analytics.
- Custom error pages and content type headers are used in other projects, showcasing the flexibility of the setup.
- The author plans to standardize projects to use 'just build' commands in Dockerfiles for consistency.