Rizwan9 commited on
Commit
4e2c7de
·
verified ·
1 Parent(s): 8500fb3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -6
Dockerfile CHANGED
@@ -1,13 +1,17 @@
1
-
2
  FROM python:3.10-slim
 
 
3
  WORKDIR /app
4
 
5
- COPY requirements.txt .
6
- RUN pip install --no-cache-dir -r requirements.txt
7
 
8
- COPY app.py best_model_random_forest.joblib ./
 
9
 
10
- ENV MODEL_PATH=best_model_random_forest.joblib
11
  EXPOSE 5000
12
 
13
- CMD ["gunicorn", "--workers", "2", "--threads", "2", "--timeout", "120", "--bind", "0.0.0.0:5000", "app:app"]
 
 
1
+ # Use official Python image
2
  FROM python:3.10-slim
3
+
4
+ # Set working directory
5
  WORKDIR /app
6
 
7
+ # Copy files to the container
8
+ COPY . /app
9
 
10
+ # Install dependencies
11
+ RUN pip install --no-cache-dir -r requirements.txt
12
 
13
+ # Expose port (Hugging Face expects 7860, but Flask uses 5000 — both fine)
14
  EXPOSE 5000
15
 
16
+ # Run the app with gunicorn
17
+ CMD ["gunicorn", "--workers", "2", "--threads", "2", "--timeout", "120", "--bind", "0.0.0.0:5000", "app:app"]