# Hugging Face Docker Space for Research-Link-AI. # CPU-only, no API keys, deterministic offline drafts by default. FROM python:3.11-slim # Run as the non-root user Hugging Face Spaces expects (uid 1000). RUN useradd -m -u 1000 user USER user ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH WORKDIR /home/user/app # Install the package. COPY --chown=user:user . /home/user/app RUN pip install --no-cache-dir --user -e . # Safe public-demo defaults (override with Space Variables/Secrets): # - offline LLM mode: no keys, no GPU, deterministic grounded drafts # - bind all interfaces on the HF app port (7860) # - writable, ephemeral data/cache under the user's home ENV RESEARCHLINK_LLM_MODE=offline \ RESEARCHLINK_BIND_HOST=0.0.0.0 \ RESEARCHLINK_BACKEND_PORT=7860 \ RESEARCHLINK_OUTPUT_DIR=/home/user/app/papers \ RESEARCHLINK_CACHE_DIR=/home/user/app/.cache/researchlink EXPOSE 7860 CMD ["python", "-m", "uvicorn", "researchlink.api.app:app", "--host", "0.0.0.0", "--port", "7860"]