Rizwan9 commited on
Commit
2a186fe
·
verified ·
1 Parent(s): 45d0321

Upload Dockerfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -14
Dockerfile CHANGED
@@ -1,22 +1,19 @@
1
- FROM python:3.10-slim
 
2
 
3
- ENV PYTHONUNBUFFERED=1
4
- # keep CPU tiny runners stable
5
- ENV OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 MKL_NUM_THREADS=1 NUMEXPR_NUM_THREADS=1
6
- # provide a default in case HF doesn't inject $PORT for any reason
7
- ENV PORT=7860
8
-
9
- ARG BUILD_ID=12
10
  WORKDIR /app
11
 
 
12
  COPY requirements.txt .
13
  RUN pip install --no-cache-dir -r requirements.txt
14
 
15
- # match this filename to your actual artifact in the repo
16
- COPY app.py best_model_random_forest.joblib ./
17
- ENV MODEL_PATH=best_model_random_forest.joblib
18
 
19
- EXPOSE 7860
 
20
 
21
- # run the Flask app; it reads PORT via os.getenv("PORT", "5000")
22
- CMD ["python","app.py"]
 
1
+ # Use a lightweight Python image
2
+ FROM python:3.9-slim
3
 
4
+ # Set the working directory
 
 
 
 
 
 
5
  WORKDIR /app
6
 
7
+ # Copy the requirements file and install dependencies
8
  COPY requirements.txt .
9
  RUN pip install --no-cache-dir -r requirements.txt
10
 
11
+ # Copy the application code and the trained model
12
+ COPY app.py .
13
+ COPY best_sales_forecasting_model.pkl .
14
 
15
+ # Expose the port the app runs on
16
+ EXPOSE 5000
17
 
18
+ # Command to run the application
19
+ CMD ["flask", "run", "--host=0.0.0.0", "--port=5000"]