guides

Serverless Deployment

AWS Lambda, Google Cloud Functions, and Azure Functions with Pyvorin.

Published May 30, 2026

AWS Lambda

def lambda_handler(event, context):
    result = process_data(event['records'])
    return {'statusCode': 200, 'body': result}
# Dockerfile for Lambda
FROM public.ecr.aws/lambda/python:3.12
RUN pip install pyvorin-thin --extra-index-url https://pypi.pyvorin.com/simple
COPY app.py ${LAMBDA_TASK_ROOT}
CMD ["app.lambda_handler"]

Google Cloud Functions

import functions_framework

@functions_framework.http
def handler(request):
    data = request.get_json()
    return process_data(data)

Azure Functions

import azure.functions as func

def main(req: func.HttpRequest) -> func.HttpResponse:
    data = req.get_json()
    result = process_data(data)
    return func.HttpResponse(result)

Cold Start

Pre-compile functions during container build to minimise cold-start latency:

RUN pyvorin compile app.py --function lambda_handler