-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Labels
Description
Course
machine-learning-zoomcamp
Question
Are there common pitfalls to watch for when combining notebooks, API code, and Docker for reproducibility in larger projects?
I successfully deployed the model with Docker. Are there common pitfalls to watch for when combining notebooks, API code, and Docker for reproducibility in larger projects?
Answer
Yes, Docker helps a lot with reproducibility, but common pitfalls include missing or mismatched dependencies, hardcoded data paths, and version differences between environments. It’s also important to save trained models and test the API endpoints to ensure everything works together.
Code example(Dockerfile)
FROM python:3.13.5-slim-bookworm
WORKDIR /code
Install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
Copy application code and model
COPY app/ ./app/
Run FastAPI app
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
Checklist
- I have searched existing FAQs and this question is not already answered
- The answer provides accurate, helpful information
- I have included any relevant code examples or links