phishing / Dockerfile
AliMusaRizvi's picture
Update Dockerfile
d9aef80 verified
raw
history blame contribute delete
878 Bytes
FROM python:3.11-slim
# System deps — libgomp1 is required by LightGBM
RUN apt-get update && apt-get install -y \
git \
curl \
libgomp1 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu
# Copy model files
COPY lgbm_best.txt /app/lgbm_best.txt
# Copy app
COPY app.py .
# HF Spaces requires exactly 7860
EXPOSE 7860
ENV MODEL_REPO="AliMusaRizvi/phishing_model_for_extention"
ENV LGBM_PATH="/app/lgbm_best.txt"
# Healthcheck so HF knows when the app is truly ready
HEALTHCHECK --interval=30s --timeout=10s --start-period=120s --retries=3 \
CMD curl -f http://localhost:7860/health || exit 1
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]