dpv007 commited on
Commit
0c5da5d
·
verified ·
1 Parent(s): e3c1911

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +26 -0
Dockerfile ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use a small but recent base
2
+ FROM python:3.10-slim
3
+
4
+ # Allow apt installs for system deps (opencv needs libgl1, etc.)
5
+ RUN apt-get update && apt-get install -y --no-install-recommends \
6
+ build-essential \
7
+ libgl1 \
8
+ libglib2.0-0 \
9
+ && rm -rf /var/lib/apt/lists/*
10
+
11
+ WORKDIR /app
12
+
13
+ # Copy requirements first (for caching)
14
+ COPY requirements.txt .
15
+
16
+ # Install pip deps
17
+ RUN pip install --no-cache-dir -r requirements.txt
18
+
19
+ # Copy app code
20
+ COPY . .
21
+
22
+ # Expose the port Spaces expects by default
23
+ EXPOSE 7860
24
+
25
+ # Run uvicorn on port 7860
26
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]