dasdebanna commited on
Commit
864a510
·
1 Parent(s): f557552

Dockerfile: include sample and index/meta files into image for Spaces

Browse files
Files changed (1) hide show
  1. Dockerfile +30 -9
Dockerfile CHANGED
@@ -1,20 +1,41 @@
 
1
  FROM python:3.13.5-slim
2
 
 
 
3
  WORKDIR /app
4
 
5
- RUN apt-get update && apt-get install -y \
6
- build-essential \
7
- curl \
8
- git \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
- COPY requirements.txt ./
12
- COPY src/ ./src/
 
 
13
 
14
- RUN pip3 install -r requirements.txt
 
 
15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  EXPOSE 8501
17
 
18
- HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
 
19
 
20
- ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
 
1
+ # Dockerfile — explicit copy of runtime files for Hugging Face Spaces
2
  FROM python:3.13.5-slim
3
 
4
+ # avoid interactive prompts during apt operations
5
+ ENV DEBIAN_FRONTEND=noninteractive
6
  WORKDIR /app
7
 
8
+ # install minimal build deps some Python packages may need
9
+ RUN apt-get update && apt-get install -y --no-install-recommends \
10
+ build-essential curl git ca-certificates \
 
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
+ # copy requirements and install Python deps
14
+ COPY requirements.txt /app/requirements.txt
15
+ RUN python -m pip install --upgrade pip
16
+ RUN pip install --no-cache-dir -r /app/requirements.txt
17
 
18
+ # copy the launcher, source code and config into the image
19
+ COPY streamlit_app.py /app/streamlit_app.py
20
+ COPY src/ /app/src/
21
 
22
+ # copy runtime/sample/index/meta files explicitly into /app
23
+ # (these are referenced by your app at runtime)
24
+ COPY sample_tickets.json /app/sample_tickets.json
25
+ COPY docs_corpus.jsonl /app/docs_corpus.jsonl
26
+ COPY docs_meta.jsonl /app/docs_meta.jsonl
27
+ # optional: FAISS binary (if you want it baked into the image)
28
+ # If it's tracked via Git LFS this will still copy the pointer; LFS objects need to be handled appropriately.
29
+ COPY faiss_index.bin /app/faiss_index.bin
30
+
31
+ # copy streamlit config (if present)
32
+ COPY .streamlit /app/.streamlit
33
+
34
+ # expose default port (HF overrides with its own environment)
35
  EXPOSE 8501
36
 
37
+ # healthcheck (optional)
38
+ HEALTHCHECK --interval=30s --timeout=3s --start-period=10s CMD curl --fail http://localhost:8501/_stcore/health || exit 1
39
 
40
+ # use the launcher in the repo root (streamlit_app.py)
41
+ CMD ["streamlit", "run", "streamlit_app.py", "--server.port=8501", "--server.headless=true"]