File size: 752 Bytes
432dd69
af99309
 
 
 
 
 
 
 
 
 
 
 
 
67df41c
b11e306
bc673cf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
af99309
 
 
1dc3a7e
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
33
34
35
FROM python:3.12-slim

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y \
    build-essential \
    git \
    curl \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app

COPY . /app

RUN pip install --no-cache-dir PyYAML streamlit mistralai && pip install --no-cache-dir -e . && \
    python - <<'PY'
from pathlib import Path

path = Path("/app/cmbagent/utils/ocr.py")
text = path.read_text()

old = "from mistralai import Mistral, DocumentURLChunk"
new = """try:
    from mistralai import Mistral, DocumentURLChunk
except Exception:
    Mistral = None
    DocumentURLChunk = None
"""

path.write_text(text.replace(old, new))
PY

EXPOSE 7860

CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]