Upload Dockerfile with huggingface_hub
Browse files- Dockerfile +29 -0
Dockerfile
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ===== SuperKart Backend (Flask) =====
|
| 2 |
+
FROM python:3.11-slim
|
| 3 |
+
|
| 4 |
+
# Basic env hygiene
|
| 5 |
+
ENV PYTHONDONTWRITEBYTECODE=1 \
|
| 6 |
+
PYTHONUNBUFFERED=1 \
|
| 7 |
+
PIP_NO_CACHE_DIR=1
|
| 8 |
+
|
| 9 |
+
WORKDIR /app
|
| 10 |
+
|
| 11 |
+
# Install system deps (if you need gcc for some pip builds, uncomment the next line)
|
| 12 |
+
# RUN apt-get update && apt-get install -y --no-install-recommends build-essential && rm -rf /var/lib/apt/lists/*
|
| 13 |
+
|
| 14 |
+
# Copy requirements first for better caching
|
| 15 |
+
COPY requirements.txt /app/requirements.txt
|
| 16 |
+
|
| 17 |
+
# Install Python deps (add gunicorn here to serve Flask in production)
|
| 18 |
+
RUN pip install --no-cache-dir -r /app/requirements.txt \
|
| 19 |
+
&& pip install --no-cache-dir gunicorn==21.2.0
|
| 20 |
+
|
| 21 |
+
# Copy the backend app
|
| 22 |
+
COPY . /app
|
| 23 |
+
|
| 24 |
+
# Expose a port (Spaces will inject PORT; exposing is optional but helpful locally)
|
| 25 |
+
EXPOSE 7860
|
| 26 |
+
|
| 27 |
+
# Default to gunicorn, binding to $PORT if provided (Spaces) or 8000 locally
|
| 28 |
+
ENV PORT=7860
|
| 29 |
+
CMD ["sh", "-c", "gunicorn --bind 0.0.0.0:${PORT:-8000} app:app"]
|