Dockerfile26 lines · 744 chars FROM python:3.9-slim
WORKDIR /pkb
SHELL ["/bin/bash", "-lc"]
# Install system dependencies needed for building Python wheels
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential python3-dev libffi-dev libssl-dev ca-certificates && \
rm -rf /var/lib/apt/lists/*
COPY requirements.txt /pkb/
RUN pip install --no-cache-dir -r requirements.txt
COPY . /pkb/
RUN pip install --no-cache-dir -r requirements-testing.txt
# Optionally install the package in editable mode if setup.py exists
RUN if [ -f setup.py ]; then pip install --no-cache-dir -e .; else echo "No setup.py found, skipping editable install"; fi
# Run tests in isolation
CMD ["bash", "-lc", "python -m unittest discover -v tests"]