Skier8402 commited on
Commit
caec00d
·
verified ·
1 Parent(s): cdb228e

Upload Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +28 -0
Dockerfile ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.12-slim-bullseye
2
+
3
+ # Meta-data
4
+ LABEL maintainer="Shuyib" \
5
+ description="RAG API pipeline that allows loading of documents, indexing and question" \
6
+ version="0.0" \
7
+ security_contact="check my github profile"
8
+
9
+ # Install system deps
10
+ RUN apt-get update && apt-get install -y --no-install-recommends \
11
+ build-essential \
12
+ && rm -rf /var/lib/apt/lists/*
13
+
14
+ # Set working directory to be /app
15
+ WORKDIR /app
16
+
17
+ # Copy requirement files first for better layer caching
18
+ COPY . /app
19
+
20
+ # Install Python dependencies chain commands to reduce layers
21
+ RUN pip install --no-cache-dir --upgrade pip && \
22
+ pip install --no-cache-dir -r requirements.txt
23
+
24
+ # keep the port consistent with Uvicorn/Gunicorn binding
25
+ EXPOSE 8000
26
+
27
+ # Run Uvicorn with a production-ready worker
28
+ CMD ["gunicorn", "-k", "uvicorn.workers.UvicornWorker", "api:app", "-b", "0.0.0.0:8000", "--log-level", "info", "--timeout", "500"]