CoolFace
Apppublic

orxva/svm

sourceHugging Faceupdated 3mo agoView on Hugging Face
0likes
Dockerfile41 linesDownload Raw Back to root
1FROM python:3.11-slim2 3# Set up working directory4WORKDIR /app5 6# Install native dependencies for Cython/Scikit-learn wheel build if necessary7RUN apt-get update && apt-get install -y \8    build-essential \9    libgomp1 \10    && rm -rf /var/lib/apt/lists/*11 12# Copy requirements13COPY requirements.txt .14 15# Install dependencies16RUN pip install --no-cache-dir -r requirements.txt17 18# Copy all project files19COPY . .20 21# Set up non-root user for security (Hugging Face requirement)22RUN useradd -m -u 1000 user23USER user24ENV HOME=/home/user \25    PATH=/home/user/.local/bin:$PATH26 27# Change ownership of app directory28# Switching back to root to chown then back to user29USER root30RUN chown -R user:user /app31USER user32 33# Set Hugging Face Spaces port bindings34ENV PORT=786035 36# Expose port37EXPOSE 786038 39# Run Flask app via Python40CMD ["python", "app.py"]41