Privacy-first image optimizer. Zero-persistence, RAM-only processing. Built for high-security infra.
985
mochify/mochify-lite is a lightweight, self‑hostable image compression service built on C++20 and the Drogon web framework. It is the “lite” backend variant of Mochify, designed for secure, single‑threaded deployments with predictable resource usage.
The live service at mochify.xyz provides a more feature‑rich stack (Jpegli, AVIF, WebP, AVX512 SIMD, larger limits), while this image targets simpler, hardened self‑hosting setups.
C++ Drogon backend
High‑performance, low‑latency HTTP API implemented in C++ using Drogon’s asynchronous HTTP server.
JPEG and PNG only (up to 10 MB)
The lite image accepts JPEG and PNG input with a maximum file size of 10 MB per image, making resource usage easy to reason about.
libjpeg‑based JPEG compression
Uses libjpeg for JPEG recompression, which keeps builds smaller and dependencies simpler compared with the Jpegli stack used on the main site.
Single‑threaded by design
Processes requests on a single thread to better match low‑resource VPS or container environments and simplify performance tuning.
Security‑hardened container profile
Supports running with a read‑only filesystem, a tmpfs scratch buffer, and no new privileges, reducing the attack surface of the service.
| Aspect | mochify/mochify-lite (this Docker image) | Live site (mochify.xyz) |
|---|---|---|
| Framework | Drogon (C++ HTTP backend) | Same C++20 engine, scaled for public traffic |
| JPEG backend | libjpeg | Jpegli for higher JPEG density |
| SIMD optimizations | Minimal | AVX512‑optimized compression paths |
| Max file size per image | 10 MB | 20 MB |
| Parallel processing | Single‑threaded | Parallel jobs |
| Accepted formats | JPEG, PNG | JPEG, PNG, AVIF, WebP, JXL |
| Container hardening | Read‑only FS + tmpfs scratch recommended | Managed by Mochify infrastructure |
| Primary use case | Self‑hosted, private, low‑footprint deployments | Public, high‑throughput bulk compression |
The following example demonstrates a hardened way to run mochify-lite, with a read‑only root filesystem and a small in‑memory buffer for temporary data:
docker run -d \
--name mochify-lite \
-p 5555:5555 \
--read-only \
--tmpfs /app/temp_ram_buffer:rw,size=64m,mode=1777 \
--security-opt=no-new-privileges \
mochify/mochify-lite:latest
This setup:
A minimal example compressing a JPEG via curl:
curl -X POST "http://localhost:5555/v1/squish" \
-H "Content-Type: image/jpeg" \
--data-binary "@mochi.jpg" \
--output mochi_optimized.jpg
Notes:
Content-Type should match the image format (image/jpeg or image/png).mochi_optimized.jpg.You can integrate this into your own service (e.g., from Node, Python, Go, or C++) by issuing an HTTP POST with the image bytes and saving the response.
For larger files, more formats, and heavier optimizations (Jpegli, AVX512 paths, 20 MB limit), refer to the main Mochify deployment described at mochify.xyz.
Content type
Image
Digest
sha256:759060ff7…
Size
20.5 MB
Last updated
8 months ago
docker pull mochify/mochify-lite