Download Dockerfile from Olserra/xmem: direct link, hf CLI and curl.
- Browser
- Download file 803 Bytes
-
https://huggingface.co/spaces/Olserra/xmem/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Olserra/xmem/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Olserra/xmem/resolve/main/Dockerfile
803 Bytes
| FROM python:3.11-slim | |
| WORKDIR /app | |
| # Install build tools for packages with C extensions | |
| RUN apt-get update && apt-get install -y --no-install-recommends build-essential && rm -rf /var/lib/apt/lists/* | |
| # Install Poetry | |
| RUN pip install --no-cache-dir poetry | |
| # Copy dependency files | |
| COPY pyproject.toml poetry.lock ./ | |
| # Install dependencies | |
| RUN poetry config virtualenvs.create false \ | |
| && poetry install --no-interaction --no-ansi --no-root | |
| # Copy the rest of the application | |
| COPY . . | |
| # Set Hugging Face cache | |
| ENV HF_HOME=/app/.cache/huggingface | |
| RUN mkdir -p /app/.cache/huggingface && chmod -R 777 /app/.cache | |
| # Pre-download models | |
| RUN python -c "from keybert import KeyBERT; KeyBERT()" | |
| # Expose port (Gradio uses 7860 by default) | |
| EXPOSE 7860 | |
| # Run Gradio with FastAPI | |
| CMD ["python", "app.py"] |