# Image for the Hugging Face Space (zapell/gloop-predictor). Built by Hugging Face from the # contents of this api/ folder; see deploy/hf_upload.sh. Same install steps as # greatlakes/jobs/check_api.sbatch, which tests this setup on Great Lakes. FROM python:3.10-slim # Spaces run the container as user 1000. RUN useradd -m -u 1000 user USER user ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH \ HF_HOME=/home/user/hf_cache \ GRADIO_ANALYTICS_ENABLED=False \ MODEL_DIR=zapell/gloop-dnabert2 WORKDIR /home/user/app COPY --chown=user requirements.txt . RUN pip install --no-cache-dir --user torch==1.13.1+cpu --extra-index-url https://download.pytorch.org/whl/cpu \ && pip install --no-cache-dir --user -r requirements.txt # Bake the model into the image so a sleeping Space wakes up without re-downloading it. RUN python -c "from huggingface_hub import snapshot_download; snapshot_download('$MODEL_DIR')" COPY --chown=user . . CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]