CoolFace
Apppublic

fabrix13/aivala

sourceHugging Facemitupdated 3mo agoView on Hugging Face
0likes
Dockerfile43 linesDownload Raw Back to root
1# Use an official Python 3.10 slim image2FROM python:3.10-slim3 4# Install system dependencies required by OpenCV and PyTorch (CPU-only)5RUN apt-get update && apt-get install -y \6    ffmpeg \7    libglib2.0-0 \8    libgomp1 \9    && rm -rf /var/lib/apt/lists/*10 11 12# Set up working directory13WORKDIR /code14 15# Copy and install python dependencies16COPY requirements.txt /code/requirements.txt17RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt18 19# Create a non-root user (UID 1000 is required by Hugging Face Spaces)20RUN useradd -m -u 1000 user21USER user22ENV HOME=/home/user \23    PATH=/home/user/.local/bin:$PATH24 25# Set working directory inside user's home26WORKDIR $HOME/app27 28# Copy the server script and the weights file to the container29COPY --chown=user:user ai_inference_server.py .30COPY --chown=user:user best.pt .31 32# Create the static folder for annotated video storage33RUN mkdir -p static34 35# Expose port 7860 (Hugging Face's default port)36EXPOSE 786037 38# Set environment variable to make FastAPI start on Hugging Face's port39ENV AI_SERVER_PORT=786040 41# Run the FastAPI server42CMD ["python", "ai_inference_server.py"]43