RoAr777 commited on
Commit
c585d1d
·
verified ·
1 Parent(s): 096c693

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +24 -0
Dockerfile ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Start from a stable, slim Python base image
2
+ FROM python:3.9-slim
3
+
4
+ # Set the working directory inside the container
5
+ WORKDIR /app
6
+
7
+ # Copy the requirements file first for layer caching
8
+ COPY requirements.txt .
9
+
10
+ # Install Python dependencies
11
+ # --no-cache-dir reduces image size
12
+ # --prefer-binary to speed up install if possible
13
+ RUN pip install --no-cache-dir --prefer-binary -r requirements.txt
14
+
15
+ # Copy the rest of the application code
16
+ # This includes app.py and classifier.pkl (which you must upload)
17
+ COPY . .
18
+
19
+ # Hugging Face Spaces requires the app to listen on port 7860
20
+ EXPOSE 7860
21
+
22
+ # Command to run the FastAPI server using uvicorn
23
+ # --host 0.0.0.0 makes it accessible from outside the container
24
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]