Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files12345678910111213141516171819202122232425262728# Use an official Python runtime as a parent imageFROM python:3.9# Install required system dependenciesRUN apt-get update && apt-get install -y \libgl1-mesa-glx \&& rm -rf /var/lib/apt/lists/*# Create a non-root user with a home directoryRUN useradd -m -u 1000 user# Set the user to the non-root userUSER user# Add the user's local bin to the PATHENV PATH="/home/user/.local/bin:$PATH"# Set the working directory to /appWORKDIR /app# Copy the requirements.txt file and install any dependenciesCOPY --chown=user ./requirements.txt /app/requirements.txtRUN pip install --no-cache-dir --upgrade -r /app/requirements.txt# Copy the current directory contents into the container at /appCOPY --chown=user . /app# Create the folders for uploads and results with appropriate permissions1234567891011121314151617181920212223242526272829303132# Use NVIDIA's CUDA base image with PythonFROM nvidia/cuda:11.8.0-runtime-ubuntu20.04# Set environment variablesENV LANG=C.UTF-8 LC_ALL=C.UTF-8ENV PATH="/usr/local/bin:$PATH"# Install Python and other dependenciesRUN apt-get update && apt-get install -y \python3 \python3-pip \python3-dev \libgl1-mesa-glx \&& apt-get clean && rm -rf /var/lib/apt/lists/*# Create a non-root userRUN useradd -m user# Set the user to the non-root userUSER user# Set the working directory to /appWORKDIR /app# Copy the requirements.txt file and install dependenciesCOPY --chown=user requirements.txt /app/requirements.txtRUN pip3 install --no-cache-dir --upgrade -r /app/requirements.txt# Copy the application code into the containerCOPY --chown=user . /app# Create the folders for uploads and results with appropriate permissions
Dockerfile+17-13