CoolFace
Apppublic

muffin2006/document-classification-env

sourceHugging Faceupdated 6mo agoView on Hugging Face
1likes
Dockerfile35 linesDownload Raw Back to root
1FROM python:3.11-slim2 3WORKDIR /app4 5# Install system dependencies6RUN apt-get update && apt-get install -y \7    git \8    curl \9    && rm -rf /var/lib/apt/lists/*10 11# Copy requirements and install Python dependencies12COPY requirements.txt .13RUN pip install --no-cache-dir -r requirements.txt --upgrade14 15# Copy application files16COPY . .17 18# Create non-root user19RUN useradd -m -u 1000 appuser && chown -R appuser:appuser /app20USER appuser21 22# Expose port for Hugging Face Spaces23EXPOSE 786024 25# Health check26HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \27    CMD python -c "import gymnasium; from environment import DocumentClassificationEnv; env = DocumentClassificationEnv('easy'); print('OK')" || exit 128 29# Default command - can be overridden30CMD ["python", "app.py"]31 32 33 34 35