opinion-summarizer / Dockerfile
Anshrathore01's picture
Add Docker deployment configuration for Hugging Face Spaces
324c33a
raw
history blame contribute delete
617 Bytes
FROM python:3.9-slim
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements and install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY . .
# Expose port 7860 (Hugging Face Spaces default)
EXPOSE 7860
# Set environment variables
ENV FLASK_APP=app.py
ENV PYTHONUNBUFFERED=1
# Run the application with gunicorn
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--workers", "2", "--timeout", "120", "app:app"]