detextly-ai-detector / Dockerfile
RafzE's picture
Create Dockerfile
515a804 verified
raw
history blame contribute delete
615 Bytes
FROM python:3.9-slim
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
gcc \
g++ \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Copy requirements first for better caching
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY . .
# Expose port (Hugging Face uses 7860)
EXPOSE 7860
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD python -c "import requests; requests.get('http://localhost:7860/health')"
# Run the app
CMD ["python", "app.py"]