joelgrus-data-science-from-scratch
SUCCESS
7m 13s
History Source
SummaryIterations1Transcript11Dockerfile
Dockerfile33 lines · 730 chars
FROM ubuntu:22.04

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && \
    apt-get install -y --no-install-recommends \
      python3 \
      python3-pip \
      build-essential \
      python3-dev \
      libjpeg-dev \
      zlib1g-dev \
      libpng-dev \
      libfreetype6-dev \
      libxml2-dev \
      libxslt1-dev \
 && rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Copy requirements first for cache efficiency
COPY requirements.txt requirements.txt
RUN python3 -m pip install --no-cache-dir -U pip setuptools wheel && \
    python3 -m pip install --no-cache-dir -r requirements.txt

# Copy the rest of the application
COPY . .

ENV PYTHONPATH=/app

# Smoke test on container start
CMD ["python3", "smoke_test.py"]