Download Dockerfile from scomb2/Michel: direct link, hf CLI and curl.
- Browser
- Download file 678 Bytes
-
https://huggingface.co/spaces/scomb2/Michel/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/scomb2/Michel/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/scomb2/Michel/resolve/main/Dockerfile
678 Bytes
| FROM python:3.11-slim | |
| WORKDIR /app | |
| # libpq-dev is required for psycopg2; build-essential for native extensions | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| build-essential \ | |
| libpq-dev \ | |
| && rm -rf /var/lib/apt/lists/* | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Pre-download the sentence-transformers model at build time so cold starts are fast | |
| RUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('all-MiniLM-L6-v2')" | |
| COPY . . | |
| # HF Spaces requires port 7860 | |
| EXPOSE 7860 | |
| CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "7860"] | |