Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files6 unmodified lines78910111213141516171819202122236 unmodified lineslibglib2.0-0 \&& rm -rf /var/lib/apt/lists/*WORKDIR /code# Copy requirements and installCOPY requirements.txt .RUN pip install --no-cache-dir --upgrade -r requirements.txt# Pre-download the birefnet-general-lite model so the first request is instantRUN python -c "from rembg import new_session; new_session('birefnet-general-lite')"# Copy the rest of the applicationCOPY . .# Expose port 7860 (Hugging Face Spaces default port)EXPOSE 78606 unmodified lines78910111213141516171819202122232425262728293031323334356 unmodified lineslibglib2.0-0 \&& rm -rf /var/lib/apt/lists/*# Create user with UID 1000 for Hugging Face Spaces compatibilityRUN useradd -m -u 1000 userENV HOME=/home/userENV PATH=/home/user/.local/bin:$PATHENV U2NET_HOME=/home/user/.u2netWORKDIR /home/user/app# Change ownership of working directory to userRUN chown -R user:user /home/user# Switch to the non-root userUSER user# Copy requirements and installCOPY --chown=user requirements.txt .RUN pip install --no-cache-dir --upgrade -r requirements.txt# Pre-download the birefnet-general-lite model so the first request is instantRUN python -c "from rembg import new_session; new_session('birefnet-general-lite')"# Copy the rest of the applicationCOPY --chown=user . .# Expose port 7860 (Hugging Face Spaces default port)EXPOSE 7860
Dockerfile+15-3