Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files12345678910111213FROM python:3.9.13RUN useradd -m -u 1000 userUSER userENV PATH="/home/user/.local/bin:$PATH"WORKDIR /appCOPY --chown=user ./requirements.txt requirements.txtRUN pip install --no-cache-dir --upgrade -r requirements.txtCOPY --chown=user . /appCMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]1234567891011121314151617181920212223242526272829# Use an official Python runtime as a parent imageFROM python:3.9.13# Create a new user with a specific UID and home directoryRUN useradd -m -u 1000 user# Set the user for subsequent instructionsUSER user# Update the PATH environment variableENV PATH="/home/user/.local/bin:$PATH"# Set the working directoryWORKDIR /app# Copy the requirements file into the containerCOPY --chown=user ./requirements.txt requirements.txt# Install any needed packages specified in requirements.txtRUN pip install --no-cache-dir --upgrade -r requirements.txt# Copy the current directory contents into the container at /appCOPY --chown=user . /app# Make sure uvicorn is installed and available in the PATHRUN pip install --user uvicorn# Command to run the application using UvicornCMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
Dockerfile+17-1