Spaces:
Running
Running
Create Dockerfile
Browse files- Dockerfile +48 -0
Dockerfile
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use latest Python 3.11 patch release from the official image line
|
| 2 |
+
FROM python:3.11-slim
|
| 3 |
+
|
| 4 |
+
# Avoid interactive prompts during apt installs
|
| 5 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
| 6 |
+
|
| 7 |
+
# Gradio defaults (HF Spaces expects port 7860)
|
| 8 |
+
ENV GRADIO_SERVER_NAME=0.0.0.0
|
| 9 |
+
ENV GRADIO_SERVER_PORT=7860
|
| 10 |
+
ENV PYTHONUNBUFFERED=1
|
| 11 |
+
ENV PIP_NO_CACHE_DIR=1
|
| 12 |
+
|
| 13 |
+
WORKDIR /app
|
| 14 |
+
|
| 15 |
+
# System deps that commonly help with pycaret[full] and its optional deps
|
| 16 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 17 |
+
build-essential \
|
| 18 |
+
gcc g++ \
|
| 19 |
+
git \
|
| 20 |
+
curl \
|
| 21 |
+
libgomp1 \
|
| 22 |
+
libgl1 \
|
| 23 |
+
libglib2.0-0 \
|
| 24 |
+
libsm6 \
|
| 25 |
+
libxext6 \
|
| 26 |
+
libxrender1 \
|
| 27 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 28 |
+
|
| 29 |
+
# Copy dependency files first for better Docker layer caching
|
| 30 |
+
COPY requirements.txt /app/requirements.txt
|
| 31 |
+
|
| 32 |
+
# Upgrade pip tooling
|
| 33 |
+
RUN python -m pip install --upgrade pip setuptools wheel
|
| 34 |
+
|
| 35 |
+
# Install pycaret full + gradio explicitly.
|
| 36 |
+
# Your requirements.txt currently lists "scikit-learn" and "pycaret" :contentReference[oaicite:2]{index=2},
|
| 37 |
+
# but you asked specifically for pycaret[full].
|
| 38 |
+
RUN python -m pip install \
|
| 39 |
+
"pycaret[full]" \
|
| 40 |
+
gradio \
|
| 41 |
+
-r /app/requirements.txt
|
| 42 |
+
|
| 43 |
+
# Copy the rest of the repo (app.py, csv, pkl, etc.)
|
| 44 |
+
COPY . /app
|
| 45 |
+
|
| 46 |
+
EXPOSE 7860
|
| 47 |
+
|
| 48 |
+
CMD ["python", "app.py"]
|