Ryanfafa commited on
Commit
aa776c7
·
verified ·
1 Parent(s): 34d6481

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -16
Dockerfile CHANGED
@@ -1,45 +1,34 @@
1
  FROM python:3.10-slim
2
 
3
- # System dependencies
4
  RUN apt-get update && apt-get install -y \
5
- build-essential \
6
- curl \
7
- git \
8
- libgl1 \
9
- libglib2.0-0 \
10
  poppler-utils \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
  # Create non-root user (required by HuggingFace Spaces)
14
  RUN useradd -m -u 1000 appuser
15
-
16
  WORKDIR /app
17
 
18
- # Copy and install Python dependencies
19
  COPY requirements.txt .
20
  RUN pip install --no-cache-dir --upgrade pip && \
21
  pip install --no-cache-dir -r requirements.txt
22
 
23
- # Copy app files
24
  COPY --chown=appuser:appuser . .
25
 
26
- # Create writable directories for ChromaDB and sample docs
27
  RUN mkdir -p /app/chroma_db /app/sample_docs && \
28
  chown -R appuser:appuser /app/chroma_db /app/sample_docs
29
 
30
  USER appuser
31
 
32
- # Expose Streamlit port
33
  EXPOSE 7860
34
 
35
- # Health check
36
- HEALTHCHECK CMD curl --fail http://localhost:7860/_stcore/health || exit 1
37
-
38
- # Run Streamlit on port 7860 (required by HuggingFace Spaces)
39
  CMD ["streamlit", "run", "app.py", \
40
  "--server.port=7860", \
41
  "--server.address=0.0.0.0", \
42
  "--server.headless=true", \
43
  "--server.enableCORS=false", \
44
  "--server.enableXsrfProtection=false", \
45
- "--browser.gatherUsageStats=false"]
 
1
  FROM python:3.10-slim
2
 
3
+ # Minimal system deps only
4
  RUN apt-get update && apt-get install -y \
 
 
 
 
 
5
  poppler-utils \
6
  && rm -rf /var/lib/apt/lists/*
7
 
8
  # Create non-root user (required by HuggingFace Spaces)
9
  RUN useradd -m -u 1000 appuser
 
10
  WORKDIR /app
11
 
12
+ # Install Python deps
13
  COPY requirements.txt .
14
  RUN pip install --no-cache-dir --upgrade pip && \
15
  pip install --no-cache-dir -r requirements.txt
16
 
17
+ # Copy app
18
  COPY --chown=appuser:appuser . .
19
 
20
+ # Writable dirs
21
  RUN mkdir -p /app/chroma_db /app/sample_docs && \
22
  chown -R appuser:appuser /app/chroma_db /app/sample_docs
23
 
24
  USER appuser
25
 
 
26
  EXPOSE 7860
27
 
 
 
 
 
28
  CMD ["streamlit", "run", "app.py", \
29
  "--server.port=7860", \
30
  "--server.address=0.0.0.0", \
31
  "--server.headless=true", \
32
  "--server.enableCORS=false", \
33
  "--server.enableXsrfProtection=false", \
34
+ "--browser.gatherUsageStats=false"]