Pare-AI-Chatbot / Dockerfile
akashpatil8150
Fix: Reduce to 1 worker to prevent duplicate API calls and 429 errors
9eb4e65
Raw
History Blame Contribute Delete
561 Bytes
# Use official Python 3.11 slim image
FROM python:3.11-slim
# Set working directory
WORKDIR /app
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PORT=7860
# Install dependencies first (cached layer)
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy project files
COPY . .
# Expose port 7860 (required by Hugging Face Spaces)
EXPOSE 7860
# Start the app with gunicorn
CMD ["gunicorn", "app:app", "--bind", "0.0.0.0:7860", "--workers", "1", "--timeout", "120", "--log-level", "info"]