mariaanwer commited on
Commit
cc1f05b
·
verified ·
1 Parent(s): e616cdc

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -15
Dockerfile CHANGED
@@ -1,10 +1,8 @@
1
- # Switching to 3.12-slim for better stability with ChromaDB/PySQLite wheels
2
  FROM python:3.12-slim
3
 
4
  WORKDIR /app
5
 
6
  # Install system dependencies
7
- # Added libmagic1 which is often required by the python-magic library
8
  RUN apt-get update && apt-get install -y \
9
  build-essential \
10
  curl \
@@ -12,31 +10,25 @@ RUN apt-get update && apt-get install -y \
12
  libmagic1 \
13
  && rm -rf /var/lib/apt/lists/*
14
 
15
- # 1. Install requirements first for better layer caching
16
  COPY requirements.txt ./
17
  RUN pip3 install --no-cache-dir -r requirements.txt
18
 
19
- # 2. Copy the entire project
20
- # This naturally includes .streamlit/ and src/ if they exist
21
  COPY . .
22
 
23
- # 3. Ensure the /tmp directory is writeable (Essential for ChromaDB in Docker)
24
- RUN chmod -R 777 /tmp
 
 
25
 
26
  EXPOSE 8501
27
 
28
- # Healthcheck to ensure the container is running correctly
29
  HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
30
 
31
- # Updated Entrypoint to fix AxiosError 403
32
- # --server.enableXsrfProtection=false: Fixes 403 Forbidden on file uploads
33
- # --server.enableCORS=false: Prevents cross-origin issues in cloud environments
34
- # --server.maxUploadSize=50: Increases upload limit to 50MB for large PDFs
35
  ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", \
36
  "--server.port=8501", \
37
  "--server.address=0.0.0.0", \
38
  "--server.enableXsrfProtection=false", \
39
  "--server.enableCORS=false", \
40
- "--server.maxUploadSize=50"]
41
- WORKDIR /app
42
- RUN mkdir -p /tmp/chroma_db && chmod 777 /tmp/chroma_db
 
 
1
  FROM python:3.12-slim
2
 
3
  WORKDIR /app
4
 
5
  # Install system dependencies
 
6
  RUN apt-get update && apt-get install -y \
7
  build-essential \
8
  curl \
 
10
  libmagic1 \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
+ # Install requirements
14
  COPY requirements.txt ./
15
  RUN pip3 install --no-cache-dir -r requirements.txt
16
 
17
+ # Copy the project
 
18
  COPY . .
19
 
20
+ # --- FIX START: Move these ABOVE the Entrypoint ---
21
+ # Create the specific DB folder and give it full permissions
22
+ RUN mkdir -p /tmp/chroma_db && chmod -R 777 /tmp/chroma_db
23
+ # --- FIX END ---
24
 
25
  EXPOSE 8501
26
 
 
27
  HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
28
 
 
 
 
 
29
  ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", \
30
  "--server.port=8501", \
31
  "--server.address=0.0.0.0", \
32
  "--server.enableXsrfProtection=false", \
33
  "--server.enableCORS=false", \
34
+ "--server.maxUploadSize=50"]