rajdip226's picture
Upload folder using huggingface_hub
895378b verified
raw
history blame contribute delete
710 Bytes
# Use Python 3.9 slim base image
FROM python:3.9-slim
# Set working directory inside the container
WORKDIR /app
# Install system dependencies (optional, but good for pandas/numpy)
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first to leverage Docker cache
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy everything else (Flask app, model, etc.)
COPY . .
# Expose the port (Hugging Face will map it automatically)
EXPOSE 7860
# Run Flask app with Gunicorn (4 workers, port 7860)
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:7860", "main:app"]