subhdotsol commited on
Commit
04af49f
·
1 Parent(s): 439cb9a

feat: add Dockerfile targeting port 7860 for HuggingFace Spaces

Browse files
Files changed (1) hide show
  1. Dockerfile +24 -0
Dockerfile ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # System deps
6
+ RUN apt-get update && apt-get install -y --no-install-recommends \
7
+ build-essential \
8
+ && rm -rf /var/lib/apt/lists/*
9
+
10
+ # Python deps first (cached layer)
11
+ COPY requirements.txt .
12
+ RUN pip install --no-cache-dir -r requirements.txt
13
+
14
+ # Copy source
15
+ COPY . .
16
+
17
+ # Non-root user (HuggingFace Spaces requirement)
18
+ RUN useradd -m -u 1000 appuser && chown -R appuser:appuser /app
19
+ USER appuser
20
+
21
+ # HuggingFace Spaces uses port 7860
22
+ EXPOSE 7860
23
+
24
+ CMD ["uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "7860"]