joelgrus-data-science-from-scratch
SUCCESS
3m 58s
History Source
SummaryIterations1Transcript3Dockerfile
01Iteration 1
WRITEWriteFile· step #1
0s
Dockerfile852 bytes written
text32 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]))'"]
WRITEWriteFile· step #2
0s
./.dockerignore335 bytes written
dockerignore42 lines · 335 chars
__pycache__/
*.pyc
*.pyo
*.pyd
.Python
env/
venv/
ENV/
build/
dist/
.eggs/
.eggs-info/
*.egg-info/
*.egg
*.log
.DS_Store
*.sqlite
*.sqlite3

# Node modules (in case project has any in subdirs)
node_modules/

# Git
.git/
.gitignore

# IDEs
.vscode/
.idea/
*.swp
*.swo

# Distribution archives
*.tar.gz
*.whl
*.zip

# Misc
*.tmp
*.temp

VERIFYVerifyBuild· step #3
2m 35s
VerifyBuildaccepted
Smoke [PASS]: python -c 'import scratch.linear_algebra as la; print(la.dot([1,2,3],[4,5,6]))' | grep -q 32
Smoke [PASS]: python -c 'import scratch.linear_algebra as la; print(la.dot([0,0,0],[1,2,3]))' | grep -q 0