joelgrus-data-science-from-scratch
SUCCESS
3m 58s
History Source
SummaryIterations1Transcript3Dockerfile
Dockerfile32 lines · 852 chars
FROM python:3.11-slim

ENV PYTHONUNBUFFERED=1

WORKDIR /app

# Install system dependencies needed for common Python packages (e.g., matplotlib, pillow)
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
        build-essential \
        libjpeg-dev \
        libfreetype6-dev \
        libpng-dev \
        zlib1g-dev \
        libxml2-dev \
        libxslt1-dev \
        libffi-dev \
        libssl-dev \
        ca-certificates \
    && rm -rf /var/lib/apt/lists/*

# Install Python dependencies
COPY requirements.txt .
RUN pip install --upgrade pip setuptools wheel \
    && pip install -r requirements.txt

# Copy the source code
COPY . .

# Simple smoke test to verify container works (will print 32 for the dot product)
CMD ["bash", "-lc", "python -c 'import scratch.linear_algebra as la; print(la.dot([1,2,3],[4,5,6]))'"]