Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files1234567891011121314151617181920212223242526272829# Use an official Python runtime as a parent imageFROM python:3.10-slim# Set the working directory in the containerWORKDIR /app# Copy the requirements fileCOPY requirements.txt requirements.txt# Install Python packagesRUN pip install --no-cache-dir -r requirements.txt# Copy application codeCOPY . /app# Create a non-root userRUN useradd -m -u 1000 user# Change ownershipRUN chown -R user:user /app# Switch to the non-root userUSER user# Expose the port Gunicorn will run on (Using 7860 as in CMD)EXPOSE 7860# Command to run the appCMD ["python", "app.py", "--host", "0.0.0.0", "--port", "7860"]12345678910111213141516171819202122232425262728293031323334353637383940# Use an official Python runtime as a parent imageFROM python:3.10-slim# Set the working directory in the containerWORKDIR /app# Install system dependencies for OpenCV and other packagesRUN apt-get update && apt-get install -y \libgl1-mesa-glx \libglib2.0-0 \libsm6 \libxext6 \libxrender-dev \libgomp1 \libgthread-2.0-0 \&& rm -rf /var/lib/apt/lists/*# Copy the requirements fileCOPY requirements.txt requirements.txt# Install Python packagesRUN pip install --no-cache-dir -r requirements.txt# Copy application codeCOPY . /app# Create a non-root userRUN useradd -m -u 1000 user# Change ownershipRUN chown -R user:user /app# Switch to the non-root userUSER user# Expose the port Gunicorn will run on (Using 7860 as in CMD)EXPOSE 7860# Command to run the appCMD ["python", "app.py", "--host", "0.0.0.0", "--port", "7860"]
Dockerfile+39-28