DhanashreeP commited on
Commit
6aa7302
ยท
verified ยท
1 Parent(s): 042b4b0

๐Ÿš€ Upload Flask + Docker backend files

Browse files
Dockerfile CHANGED
@@ -1,21 +1,18 @@
1
  FROM python:3.9-slim
2
 
 
3
  WORKDIR /app
4
 
5
- RUN apt-get update && apt-get install -y \
6
- build-essential \
7
- curl \
8
- software-properties-common \
9
- git \
10
- && rm -rf /var/lib/apt/lists/*
11
 
12
- COPY requirements.txt ./
13
- COPY src/ ./src/
 
14
 
15
- RUN pip3 install -r requirements.txt
 
16
 
17
- EXPOSE 8501
18
-
19
- HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
20
-
21
- ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
1
  FROM python:3.9-slim
2
 
3
+ # Set working directory inside the container
4
  WORKDIR /app
5
 
6
+ # Copy all files from current directory to container
7
+ COPY . .
 
 
 
 
8
 
9
+ # Install Python dependencies
10
+ RUN pip install --no-cache-dir --upgrade pip
11
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
12
 
13
+ # Expose the port the app runs on
14
+ EXPOSE 7860
15
 
16
+ # Command to run the application using Gunicorn
17
+ # - `app:superkart_sales_api` -> 'superkart_sales_api' is the Flask app instance in SuperKart_Sales_Predictor.py
18
+ CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:7860", "SuperKart_Sales_Predictor:superkart_sales_api"]
 
 
requirements.txt CHANGED
@@ -1,3 +1,20 @@
1
- altair
2
- pandas
3
- streamlit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ numpy==2.0.2
3
+ pandas==2.2.2
4
+ scikit-learn==1.6.1
5
+ xgboost==2.1.4
6
+ joblib==1.4.2
7
+ flask==2.2.2
8
+ Werkzeug==2.3.8
9
+ gunicorn==20.1.0
10
+ requests==2.28.1
11
+ python-dateutil>=2.8.2
12
+ pytz>=2020.1
13
+ tzdata>=2022.7
14
+ scipy>=1.6.0
15
+ threadpoolctl>=3.1.0
16
+ nvidia-nccl-cu12==2.27.3
17
+ importlib-metadata>=3.6.0
18
+ click>=8.0
19
+ itsdangerous>=2.0
20
+ Jinja2>=3.0
superkart_prediction_xgb_final_model_v1.joblib ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:de57d65a0f5be09cc1ee5b002deca487096dca2b103cd550af8e864bd74f9327
3
+ size 421637