yifan0sun commited on
Commit
2dab9bf
·
1 Parent(s): 993b547

dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -0
Dockerfile ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use lightweight Python image
2
+ FROM python:3.10-slim
3
+
4
+ # Install system dependencies
5
+ RUN apt-get update && apt-get install -y git && apt-get clean
6
+
7
+ # Set working directory
8
+ WORKDIR /app
9
+
10
+ # Copy requirements and install them
11
+ COPY requirements.txt .
12
+ RUN pip install --no-cache-dir -r requirements.txt
13
+
14
+ # Copy the rest of the backend code
15
+ COPY . .
16
+
17
+ # Expose the port expected by Hugging Face Spaces (7860 or 8000 both work)
18
+ EXPOSE 7860
19
+
20
+ # Run FastAPI app using Uvicorn
21
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]