Spaces:
Running
Running
Download Dockerfile from misukisu/embeddinggemma-2-api: direct link, hf CLI and curl.
- Browser
- Download file 893 Bytes
-
https://huggingface.co/spaces/misukisu/embeddinggemma-2-api/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/misukisu/embeddinggemma-2-api/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/misukisu/embeddinggemma-2-api/resolve/main/Dockerfile
893 Bytes
| FROM python:3.11-slim | |
| ENV PYTHONDONTWRITEBYTECODE=1 \ | |
| PYTHONUNBUFFERED=1 \ | |
| HF_HOME=/tmp/hf-cache \ | |
| OMP_NUM_THREADS=2 | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| libsndfile1 ffmpeg libgomp1 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| WORKDIR /home/user/app | |
| # Install compatible CPU versions of PyTorch and TorchVision | |
| RUN pip install --no-cache-dir \ | |
| --index-url https://download.pytorch.org/whl/cpu \ | |
| torch==2.9.0 torchvision==0.24.0 | |
| COPY requirements.txt ./ | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Verify TorchVision loads correctly | |
| RUN python -c "import torch, torchvision; from torchvision.transforms.v2 import functional; print('Dependencies OK')" | |
| RUN useradd --create-home --uid 1000 user | |
| COPY --chown=user:user . . | |
| USER user | |
| EXPOSE 7860 | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"] | |