A small production base image for Varn apps lives at docker/Dockerfile. It is built the same way the official python:slim and node:slim images are: a heavy builder stage compiles the release binary, and a slim runtime stage ships only the stripped binary — the toolchain and the dependency sources never reach the final image.
The binary is statically linked, so the whole Varn core is built in: the HTTP server and client, TCP/TLS/UDP sockets, the event loop, crypto and TLS (OpenSSL), zip (libzip + zlib), ffi (libffi), JSON, XML, datetime, logging, and the rest. The runtime image carries only the binary (~12 MB) plus the few shared libraries it links (libstdc++, libgcc, libm, libc) and ca-certificates for outbound TLS — nothing else, around 35 MB in total (smaller than python:slim or node:slim). The command docker image inspect varn:latest reports that real size. The docker images column may show a larger shared-layer disk figure.
The image covers the core. Pure-Lua components like
vdo(which loads a database client through ffi) orredisare your choice per app, so their runtime dependencies are not bundled — add them in your own image when you use them.
docker build -t varn:latest -f docker/Dockerfile .Base your app image on it, drop in your Lua script, and run it:
FROM varn:latest
COPY app.lua /app/app.lua
CMD ["app.lua"]docker build -t my-varn-app .
docker run --rm -p 3000:3000 my-varn-appThe entrypoint is the varn binary, so the image arguments are passed straight to it — CMD ["app.lua"] runs varn app.lua. The container runs as a non-root varn user with /app as the working directory.
A minimal app.lua:
local http = require("http")
http.createServer(function(req, res)
res:json({ hello = req.query.name or "world" })
end):listen({ host = "0.0.0.0", port = 3000 })The base image is built locally above. To share it across machines or a deployment, tag it for a registry and push it — for example GitHub Container Registry:
docker tag varn:latest ghcr.io/<org>/varn:latest
docker push ghcr.io/<org>/varn:latestThen teams base their apps on FROM ghcr.io/<org>/varn:latest without rebuilding the core.
A separate, database-backed benchmark stack (MySQL + Redis behind Varn, Node, and Python) lives under bench/ and is run with python3 varn.py bench. It is for measuring, not for production.