File size: 859 Bytes
6891424
844d778
 
 
 
 
 
 
6891424
844d778
 
6891424
 
844d778
6891424
844d778
6891424
844d778
6891424
844d778
 
6891424
 
2809008
6891424
844d778
 
2809008
6891424
 
2809008
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# ===== SuperKart Backend (Flask + Gunicorn) =====
FROM python:3.11-slim

# Basic env hygiene
ENV PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1 \
    PIP_NO_CACHE_DIR=1

# Workdir
WORKDIR /app

# (Optional) build tools if you ever need native builds
# RUN apt-get update && apt-get install -y --no-install-recommends build-essential && rm -rf /var/lib/apt/lists/*

# Install Python deps
COPY requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r /app/requirements.txt

# Copy app code (app.py, model/ if included, etc.)
COPY . /app

# Default model path (override via Space Variable if needed)
ENV MODEL_PATH=/app/model/superkart_best_tuned_RandomForest.joblib

# Expose the port HF uses (default 7860)
EXPOSE 7860
ENV PORT=7860

# Serve with gunicorn, bound to $PORT
CMD ["sh", "-c", "gunicorn --bind 0.0.0.0:${PORT:-8000} app:app"]