Bot-Detection / Dockerfile
Aadhya-R's picture
To enable log permission
06bcd3b verified
Raw
History Blame Contribute Delete
614 Bytes
FROM python:3.10-slim
WORKDIR /app
ENV PYTHONUNBUFFERED=1
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends build-essential && rm -rf /var/lib/apt/lists/*
# Install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy App Files
COPY . .
# Security: Run as non-root user (Required by Hugging Face)
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user PATH=/home/user/.local/bin:$PATH
# Launch Command (Port 7860 is HF standard)
CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app", "--timeout", "120"]