LogicGoInfotechSpaces commited on
Commit
e458bb6
·
verified ·
1 Parent(s): 90dfb80

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +44 -0
Dockerfile ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -------------------------------------------------
2
+ # Base image (CPU)
3
+ # HuggingFace recommends Python 3.10 for Spaces
4
+ # -------------------------------------------------
5
+ FROM python:3.10-slim
6
+
7
+ # -------------------------------------------------
8
+ # Set working directory
9
+ # -------------------------------------------------
10
+ WORKDIR /app
11
+
12
+ # -------------------------------------------------
13
+ # Install system dependencies
14
+ # -------------------------------------------------
15
+ RUN apt-get update && apt-get install -y --no-install-recommends \
16
+ build-essential \
17
+ libffi-dev \
18
+ && rm -rf /var/lib/apt/lists/*
19
+
20
+ # -------------------------------------------------
21
+ # Copy requirements first (better caching)
22
+ # -------------------------------------------------
23
+ COPY requirements.txt .
24
+
25
+ # -------------------------------------------------
26
+ # Install Python dependencies
27
+ # -------------------------------------------------
28
+ RUN pip install --no-cache-dir -r requirements.txt
29
+
30
+ # -------------------------------------------------
31
+ # Copy project files
32
+ # -------------------------------------------------
33
+ COPY . .
34
+
35
+ # -------------------------------------------------
36
+ # Expose port 7860 (required by HuggingFace Spaces)
37
+ # -------------------------------------------------
38
+ EXPOSE 7860
39
+
40
+ # -------------------------------------------------
41
+ # Start FastAPI app
42
+ # NOTE: HuggingFace uses 0.0.0.0 + port 7860
43
+ # -------------------------------------------------
44
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]