Vansh180 commited on
Commit
82e4808
·
2 Parent(s): c00095d 088eac1

Merge branch 'main' of https://huggingface.co/spaces/Vansh180/Hackrx6

Browse files
Files changed (1) hide show
  1. Dockerfile +26 -0
Dockerfile ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ # Install system dependencies
4
+ RUN apt-get update && apt-get install -y \
5
+ tesseract-ocr \
6
+ libgl1-mesa-glx \
7
+ && rm -rf /var/lib/apt/lists/*
8
+
9
+ # Add a non-root user for security
10
+ RUN useradd -m -u 1000 user
11
+ USER user
12
+
13
+ WORKDIR /app
14
+
15
+ # Copy requirements and install dependencies (as user)
16
+ COPY --chown=user requirements.txt requirements.txt
17
+ RUN pip install --no-cache-dir --upgrade pip && pip install --no-cache-dir -r requirements.txt
18
+
19
+ # Copy the rest of the app code
20
+ COPY --chown=user . /app
21
+
22
+ # Expose port for Hugging Face Spaces (default: 7860)
23
+ ENV PORT=7860
24
+
25
+ # Start FastAPI with uvicorn
26
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]