Docker
Building the image
Section titled “Building the image”docker build -t ogre .The Dockerfile uses a multi-stage build:
- Build stage compiles the Go binary with CGO disabled
- Final stage uses Google’s distroless image
Running
Section titled “Running”From a local build:
docker run -p 3000:3000 ogreFrom GitHub Container Registry:
docker run -p 3000:3000 ghcr.io/macawls/ogre:latestThe container starts in server mode by default, listening on port 3000.
Custom port
Section titled “Custom port”docker run -p 8080:8080 -e ADDR=:8080 ghcr.io/macawls/ogre:latestEnvironment variables
Section titled “Environment variables”| Variable | Default | Description |
|---|---|---|
ADDR | :3000 | Listen address |
CORS_ORIGIN | * | Allowed CORS origin(s), comma-separated, supports wildcards |
CACHE_MB | 64 | LRU cache size in MB |
RATE_LIMIT | 0 | Requests per second per IP (0 = unlimited) |
TIMEOUT | 10 | Render timeout in seconds |
MAX_ELEMENTS | 1000 | Max HTML elements per render |
docker run -p 3000:3000 \ -e CORS_ORIGIN=https://example.com \ -e CACHE_MB=128 \ -e RATE_LIMIT=10 \ ghcr.io/macawls/ogre:latestDocker Compose
Section titled “Docker Compose”services: ogre: image: ghcr.io/macawls/ogre:latest ports: - "3000:3000" environment: - CORS_ORIGIN=https://example.com - CACHE_MB=128 restart: unless-stoppedImage size
Section titled “Image size”The final image is minimal — distroless base with a single static binary. Typically under 10 MB.