Devashishraghav commited on
Commit
72389de
·
verified ·
1 Parent(s): dffce44

Upload Dockerfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +28 -0
Dockerfile ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.12-slim
2
+
3
+ # System dependencies for OpenCV
4
+ RUN apt-get update && apt-get install -y --no-install-recommends \
5
+ libgl1-mesa-glx \
6
+ libglib2.0-0 \
7
+ && rm -rf /var/lib/apt/lists/*
8
+
9
+ # HF Spaces requires a non-root user
10
+ RUN useradd -m -u 1000 user
11
+ USER user
12
+ ENV PATH="/home/user/.local/bin:$PATH"
13
+
14
+ WORKDIR /app
15
+
16
+ # Install Python dependencies first (layer caching)
17
+ COPY --chown=user requirements.txt .
18
+ RUN pip install --no-cache-dir --user -r requirements.txt
19
+ RUN pip install --no-cache-dir --user google-genai python-dotenv uvicorn
20
+
21
+ # Copy application code
22
+ COPY --chown=user . .
23
+
24
+ # HF Spaces uses port 7860
25
+ EXPOSE 7860
26
+
27
+ # Start the server
28
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]