Spaces:
Sleeping
Sleeping
Download Dockerfile from onevisionhealth/emb-api: direct link, hf CLI and curl.
- Browser
- Download file 761 Bytes
-
https://huggingface.co/spaces/onevisionhealth/emb-api/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/onevisionhealth/emb-api/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/onevisionhealth/emb-api/resolve/main/Dockerfile
761 Bytes
| FROM python:3.11-slim | |
| ENV PYTHONDONTWRITEBYTECODE=1 \ | |
| PYTHONUNBUFFERED=1 \ | |
| TRANSFORMERS_CACHE=/tmp/hf_cache \ | |
| HF_HOME=/tmp/hf_cache \ | |
| SENTENCE_TRANSFORMERS_HOME=/tmp/hf_cache | |
| RUN apt-get update && apt-get install -y --no-install-recommends git \ | |
| && rm -rf /var/lib/apt/lists/* | |
| WORKDIR /app | |
| COPY requirements.txt . | |
| # (optional) keep pip up to date, then install deps | |
| RUN pip install --no-cache-dir --upgrade pip \ | |
| && pip install --no-cache-dir -r requirements.txt | |
| # Ensure cache dir exists & is writable | |
| RUN mkdir -p /tmp/hf_cache && chmod -R 777 /tmp/hf_cache | |
| COPY main.py . | |
| # ENV MODEL_NAME=sentence-transformers/all-MiniLM-L6-v2 | |
| # ENV API_TOKEN=changeme | |
| CMD ["bash", "-lc", "uvicorn main:app --host 0.0.0.0 --port ${PORT:-7860}"] | |