MODULE 7.2

Dockerizing ML Apps

Docker: It packs your code, Python version, and libraries into a single "container." If it runs on your laptop, it will run on the server. No more "it works on my machine!"

Dockerfile
FROM python:3.12-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
CMD ["uvicorn", "main:app", "--host", "0.0.0.0"]
MODULE 7.3

Cloud Deployment

Platforms like Railway, Render, or AWS App Runner make deploying containers easy.