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]))'"]
__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
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