Spaces:
Running
Running
Download Dockerfile from GSMS-B/Contra-Signal: direct link, hf CLI and curl.
- Browser
- Download file 1.01 kB
-
https://huggingface.co/spaces/GSMS-B/Contra-Signal/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/GSMS-B/Contra-Signal/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/GSMS-B/Contra-Signal/resolve/main/Dockerfile
1.01 kB
| # Use official Python 3.10 slim image | |
| FROM python:3.10-slim | |
| # Set working directory | |
| WORKDIR /app | |
| # Install system dependencies (for PDF handling if needed) | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Create a non-root user (Hugging Face requirement) | |
| # User ID 1000 is the standard for HF Spaces | |
| RUN useradd -m -u 1000 user | |
| # Copy requirements first to leverage Docker cache | |
| COPY requirements.txt . | |
| # Install Python dependencies | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy the rest of the application | |
| COPY . . | |
| # Create critical directories and set permissions | |
| # These must be writable by the non-root user for persistence/uploads to work | |
| RUN mkdir -p chroma_db uploads && \ | |
| chown -R user:user /app | |
| # Switch to the non-root user | |
| USER user | |
| # Expose the standard Hugging Face port | |
| EXPOSE 7860 | |
| # Command to run the application | |
| # Note: HF expects port 7860 | |
| CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "7860"] | |