File size: 1,097 Bytes
b30f068
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
27
28
29
30
31
32
# HF Spaces removed the Streamlit SDK (create_repo now accepts only gradio|docker|static),
# so the Space runs as a Docker image that serves the same single Streamlit process.
FROM python:3.12-slim

# Spaces serve on 7860 and run the container as uid 1000. The app writes at runtime
# (embedded Qdrant store, accounts SQLite), so the tree must be owned by that user.
RUN useradd -m -u 1000 user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH \
    PYTHONUNBUFFERED=1 \
    CDMS_OFFLINE_INDEX=1 \
    QDRANT_FORCE_LOCAL=1

USER user
WORKDIR /app

# Dependency layer first so app edits don't reinstall torch/spaCy on every push.
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && \
    pip install --no-cache-dir -r requirements.txt

# App + the prebuilt offline index (data/qdrant_local, data/cdms_metadata.db).
COPY --chown=user . .

EXPOSE 7860

CMD ["streamlit", "run", "src/streamlit_app_conversational.py", \
     "--server.port=7860", \
     "--server.address=0.0.0.0", \
     "--server.headless=true", \
     "--browser.gatherUsageStats=false"]