haseebnawazz commited on
Commit
f08c942
·
verified ·
1 Parent(s): 7606f5a

Update DockerFile

Browse files
Files changed (1) hide show
  1. DockerFile +18 -17
DockerFile CHANGED
@@ -1,17 +1,18 @@
1
- # Use an official Python image
2
- FROM python:3.9
3
-
4
- # Set the working directory inside the container
5
- WORKDIR /app
6
-
7
- # Copy all project files into the container
8
- COPY api.py /app
9
-
10
- # Install dependencies
11
- RUN pip install --no-cache-dir fastapi uvicorn joblib scikit-learn numpy pandas huggingface_hub
12
-
13
- # Expose port 7860 (Hugging Face Spaces default port)
14
- EXPOSE 7860
15
-
16
- # Run the FastAPI application
17
- CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
+ # Use an official Python image
2
+ FROM python:3.9
3
+
4
+ # Set the working directory inside the container
5
+ WORKDIR /app
6
+
7
+ # Copy necessary files
8
+ COPY api.py /app
9
+ COPY requirements.txt /app
10
+
11
+ # Install dependencies
12
+ RUN pip install --no-cache-dir -r requirements.txt
13
+
14
+ # Expose port 7860 (Hugging Face default)
15
+ EXPOSE 7860
16
+
17
+ # Run the FastAPI application
18
+ CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "7860"]