ARG BASE_IMAGE=python:3.12-bookworm FROM ${BASE_IMAGE} ARG PIP_INDEX_URL=https://pypi.org/simple ARG TORCH_INDEX_URL=https://download.pytorch.org/whl/cpu ARG TORCH_CPU_VERSION=2.13.0+cpu ENV PYTHONUNBUFFERED=1 \ PYTHONDONTWRITEBYTECODE=1 \ PIP_DISABLE_PIP_VERSION_CHECK=1 \ PIP_NO_CACHE_DIR=1 \ PYTHONPATH=/opt/qa \ GENE_FAMILY_ROOT=/opt/qa COPY requirements/qa.txt /tmp/requirements.txt RUN python -m pip install --no-cache-dir \ --index-url "$TORCH_INDEX_URL" "torch==$TORCH_CPU_VERSION" \ && python -m pip install --no-cache-dir -r /tmp/requirements.txt \ && rm -f /tmp/requirements.txt COPY work/context/QA/ /opt/qa/ RUN test -f /opt/qa/.hardened-build.json \ && python -c "import sys; assert sys.version_info[:2] == (3, 12)" \ && python -c "import torch; assert torch.__version__ == '$TORCH_CPU_VERSION'; assert torch.version.cuda is None" \ && test "$(find /opt/qa -type f -name '*.so' | wc -l)" -gt 0 WORKDIR /opt/qa CMD ["python", "-m", "uvicorn", "scripts.qa_v1_1_73_server:app", "--host", "0.0.0.0", "--port", "7925"]