WanIrfan commited on
Commit
d9783e2
·
verified ·
1 Parent(s): 99d960b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -14
Dockerfile CHANGED
@@ -1,34 +1,26 @@
1
  # Use Python 3.11 (to match your local environment)
2
  FROM python:3.11-slim
3
 
4
- # Set the working directory to /app
5
  WORKDIR /app
6
 
7
- # Install system dependencies (needed for compiling packages like flashrank)
8
  RUN apt-get update && apt-get install -y \
9
  build-essential \
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
- # Copy requirements first to cache dependencies
13
  COPY requirements.txt .
14
-
15
- # Install Python dependencies
16
- # --no-cache-dir keeps the image size smaller
17
  RUN pip install --no-cache-dir -r requirements.txt
18
 
19
- # Copy all your code (app_1.py, src/, templates/, etc.) into the container
20
  COPY . .
21
 
22
- # Create writable directories for the database and file uploads
23
- # The 'chmod -R 777' gives the container permission to write here
24
  RUN mkdir -p /app/chroma_db && chmod -R 777 /app/chroma_db
25
  RUN mkdir -p /app/Uploads && chmod -R 777 /app/Uploads
 
 
26
 
27
- # Tell Docker that the container will listen on port 7860
28
  EXPOSE 7860
29
 
30
- # --- The Command to Run Your App ---
31
- # We use Gunicorn, a production-grade server
32
- # It looks for the 'app_1.py' file and the 'app' object inside it
33
- # --timeout 300 gives your RAG system 5 minutes to respond before timing out
34
  CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app", "--timeout", "300"]
 
1
  # Use Python 3.11 (to match your local environment)
2
  FROM python:3.11-slim
3
 
 
4
  WORKDIR /app
5
 
6
+ # Install build tools
7
  RUN apt-get update && apt-get install -y \
8
  build-essential \
9
  && rm -rf /var/lib/apt/lists/*
10
 
 
11
  COPY requirements.txt .
 
 
 
12
  RUN pip install --no-cache-dir -r requirements.txt
13
 
 
14
  COPY . .
15
 
16
+ # --- HERE IS THE FIX ---
17
+ # Create writable directories for the database, uploads, AND sessions
18
  RUN mkdir -p /app/chroma_db && chmod -R 777 /app/chroma_db
19
  RUN mkdir -p /app/Uploads && chmod -R 777 /app/Uploads
20
+ RUN mkdir -p /app/flask_session && chmod -R 777 /app/flask_session
21
+ # -----------------------
22
 
 
23
  EXPOSE 7860
24
 
25
+ # Point to app_1.py
 
 
 
26
  CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app", "--timeout", "300"]