Pyvorin Docker Best Practices
May 30, 2026 | 5 min read
Multi-Stage Build
FROM python:3.12 as compiler
RUN pip install pyvorin-thin
COPY . /app
WORKDIR /app
RUN pyvorin compile app.py --function main
FROM python:3.12-slim
COPY --from=compiler /app /app
COPY --from=compiler /root/.pyvorin/cache /root/.pyvorin/cache
Cache Layer
Pre-compile during build so runtime needs no compiler.
Image Size
Use slim or alpine final images. Compiled artifacts are small .so files.