Spaces:
Runtime error
Runtime error
Download Dockerfile from low-key-007/chatbot-2: direct link, hf CLI and curl.
- Browser
- Download file 830 Bytes
-
https://huggingface.co/spaces/low-key-007/chatbot-2/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/low-key-007/chatbot-2/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/low-key-007/chatbot-2/resolve/main/Dockerfile
830 Bytes
| FROM python:3.11-slim | |
| # Set working directory | |
| WORKDIR /app | |
| # Install system deps (needed for FAISS, docx, pypdf etc.) | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| build-essential \ | |
| libgomp1 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy project files | |
| COPY requirements.txt . | |
| COPY app.py . | |
| # Install Python deps | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Create persistent storage directory | |
| RUN mkdir -p /data/store | |
| # ✅ Fix: ensure non-root user and give permissions | |
| RUN useradd -ms /bin/bash appuser && chown -R appuser:appuser /data/store | |
| USER appuser | |
| # Declare /data as persistent volume | |
| VOLUME /data | |
| # Expose port for Hugging Face Spaces (they set $PORT) | |
| EXPOSE 7860 | |
| # ✅ Use HF $PORT instead of hardcoding 7860 | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] | |