Docker Deployment
Kiln binaries are 100% self-contained and run on minimal container bases like oven/bun:alpine or debian:bookworm-slim without copying node_modules or running npm install.
Minimal Dockerfile Example
Section titled “Minimal Dockerfile Example”# Multi-stage buildFROM oven/bun:alpine AS builderWORKDIR /app
# Install dependencies and buildCOPY package.json bun.lock ./RUN bun install --frozen-lockfile
COPY . .RUN bun run build:compile
# Production runner stageFROM oven/bun:alpine AS runnerWORKDIR /app
# Copy ONLY the compiled binaryCOPY --from=builder /app/bin/app /app/app
# Pre-extract runtime files during container buildRUN ["/app/app", "--extract"]
EXPOSE 3000ENV PORT=3000ENV HOSTNAME=0.0.0.0
CMD ["/app/app"]Why Pre-Extract with --extract?
Section titled “Why Pre-Extract with --extract?”When running in containerized environments (Kubernetes, AWS ECS, Fly.io, Railway), running:
RUN ["/app/app", "--extract"]during docker build materializes the runtime files directly into the container’s immutable image layer.
Result:
Section titled “Result:”- Instant Container Startup: When your container boots, extraction is already complete. It starts handling HTTP requests in 0ms.
- No Runtime Disk Overhead: Saves memory and disk write operations inside ephemeral container environments.
