# CanLex Web (Path B) -- the private Gradio front-end. # # A thin client: it carries no corpus and loads no models. It calls the deployed # CanLex MCP server for retrieval and Google Gemini for answer composition. # Builds on Hugging Face Spaces (sdk: docker) or with plain Docker. FROM python:3.12-slim # Run as a non-root user (UID 1000) -- required by Hugging Face Spaces. RUN useradd --create-home --home-dir /app --uid 1000 app WORKDIR /app # Python dependencies first, so this layer caches across code changes. COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY --chown=app:app app.py . USER app ENV HOME=/app \ PORT=7860 \ PYTHONUNBUFFERED=1 \ GRADIO_ANALYTICS_ENABLED=False EXPOSE 7860 CMD ["python", "app.py"]