muddasser commited on
Commit
e940617
·
verified ·
1 Parent(s): 82a7f67

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -16
Dockerfile CHANGED
@@ -1,26 +1,24 @@
1
- FROM python:3.12-slim
2
 
3
- WORKDIR /app
4
-
5
- RUN apt-get update && apt-get install -y \
6
- build-essential curl git \
7
  && rm -rf /var/lib/apt/lists/*
8
 
 
 
9
  COPY requirements.txt .
10
  RUN pip install --no-cache-dir -r requirements.txt
11
 
12
- # Download spaCy
13
- RUN python -m spacy download en_core_web_sm
14
-
15
  COPY app.py .
16
 
17
- RUN mkdir -p /app/user_memory
 
18
 
19
- EXPOSE 8501
20
 
21
- # IMPORTANT: Disable XSRF and CORS via command line (most reliable in Docker)
22
- ENTRYPOINT ["streamlit", "run", "app.py", \
23
- "--server.port=8501", \
24
- "--server.address=0.0.0.0", \
25
- "--server.enableXsrfProtection=false", \
26
- "--server.enableCORS=false"]
 
1
+ FROM python:3.11-slim
2
 
3
+ # libgomp1 is needed by faiss-cpu on slim images
4
+ RUN apt-get update && apt-get install -y --no-install-recommends libgomp1 \
 
 
5
  && rm -rf /var/lib/apt/lists/*
6
 
7
+ WORKDIR /app
8
+
9
  COPY requirements.txt .
10
  RUN pip install --no-cache-dir -r requirements.txt
11
 
 
 
 
12
  COPY app.py .
13
 
14
+ ENV HF_HOME=/tmp/hf \
15
+ STREAMLIT_BROWSER_GATHER_USAGE_STATS=false
16
 
17
+ EXPOSE 7860
18
 
19
+ # XSRF/CORS are disabled because file uploads fail inside the Hugging Face Spaces iframe otherwise
20
+ CMD ["streamlit", "run", "app.py", \
21
+ "--server.port=7860", \
22
+ "--server.address=0.0.0.0", \
23
+ "--server.enableXsrfProtection=false", \
24
+ "--server.enableCORS=false"]