WanIrfan commited on
Commit
b60cabd
·
verified ·
1 Parent(s): 9ab9fe5

Update docker

Browse files
Files changed (1) hide show
  1. docker +34 -34
docker CHANGED
@@ -1,34 +1,34 @@
1
- # Use Python 3.10 (Stable for LangChain & Flashrank)
2
- FROM python:3.10-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/, api.py) 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_1:app", "--timeout", "300"]
 
1
+ # Use Python 3.10 (Stable for LangChain & Flashrank)
2
+ FROM python:3.10-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/, api.py) 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"]