# v2 (with ESM-2). To use: cp Dockerfile.esm Dockerfile FROM python:3.11-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends libgomp1 libxrender1 libxext6 \ && rm -rf /var/lib/apt/lists/* RUN useradd --create-home --uid 1000 user WORKDIR /app # CPU-only PyTorch: the grader has no GPU, and the CUDA build is ~5 GB larger and slower to build RUN pip install --no-cache-dir --retries 10 --timeout 120 torch==2.14.1 --index-url https://download.pytorch.org/whl/cpu COPY requirements.txt requirements-esm.txt ./ RUN pip install --no-cache-dir --retries 10 --timeout 120 -r requirements.txt -r requirements-esm.txt COPY --chown=user:user . . USER user # no network at inference: never try to reach the Hugging Face Hub; caches go to /tmp (the only writable place) ENV OMP_NUM_THREADS=2 OPENBLAS_NUM_THREADS=2 HF_HUB_OFFLINE=1 TRANSFORMERS_OFFLINE=1 HF_HOME=/tmp/hf CMD ["python", "/app/predict.py", "--help"]