File size: 765 Bytes
c0ff3c7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# 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"]