Spaces:
Running
Running
| # ------------------------------------------------------------------------------ | |
| # DCI-Agent Search – Hugging Face Spaces Docker | |
| # Prestige Purple themed Gradio app for autonomous document search | |
| # ------------------------------------------------------------------------------ | |
| FROM python:3.11-slim | |
| # Prevent Python from writing pyc files and buffering stdout | |
| ENV PYTHONDONTWRITEBYTECODE=1 | |
| ENV PYTHONUNBUFFERED=1 | |
| ENV PORT=7860 | |
| # ------------------------------------------------------------------------------ | |
| # System dependencies | |
| # ------------------------------------------------------------------------------ | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| curl \ | |
| ca-certificates \ | |
| git \ | |
| gnupg \ | |
| build-essential \ | |
| ripgrep \ | |
| unzip \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # ------------------------------------------------------------------------------ | |
| # Install Node.js 20+ (required for native pi-mono) | |
| # ------------------------------------------------------------------------------ | |
| RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ | |
| && apt-get install -y nodejs \ | |
| && rm -rf /var/lib/apt/lists/* | |
| RUN node --version && npm --version | |
| # ------------------------------------------------------------------------------ | |
| # Required: clone and build pi-mono | |
| # If this fails, the image build should fail so HF uses the native PI path. | |
| # ------------------------------------------------------------------------------ | |
| RUN git clone --depth 1 --branch codex/context-management-ablation \ | |
| https://github.com/jdf-prog/pi-mono.git /app/pi-mono | |
| RUN cd /app/pi-mono && npm install | |
| RUN cd /app/pi-mono && npm run build | |
| RUN test -f /app/pi-mono/packages/coding-agent/dist/cli.js | |
| # ------------------------------------------------------------------------------ | |
| # Python dependencies | |
| # ------------------------------------------------------------------------------ | |
| WORKDIR /app | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # ------------------------------------------------------------------------------ | |
| # Copy app code | |
| # ------------------------------------------------------------------------------ | |
| COPY . /app | |
| # Ensure default corpus is present | |
| RUN ls -la /app/default_corpus/ || echo "WARNING: default_corpus not found" | |
| # ------------------------------------------------------------------------------ | |
| # Expose and run | |
| # ------------------------------------------------------------------------------ | |
| EXPOSE 7860 | |
| CMD ["python", "app.py"] | |