Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files1234456789101 unmodified line121314121516171816192021192223# Use Python 3.9 as the base imageFROM python:3.9
# Create a user to avoid running as root# Install OpenGL library for OpenCVRUN apt-get update && apt-get install -y libgl1
# Create a non-root user for securityRUN useradd -m -u 1000 userUSER userENV PATH="/home/user/.local/bin:$PATH"1 unmodified line# Set the working directoryWORKDIR /app
# Copy dependencies and install them# Copy the requirements.txt file and install dependenciesCOPY --chown=user ./requirements.txt requirements.txtRUN pip install --no-cache-dir --upgrade -r requirements.txt
# Copy the app code# Copy the app source codeCOPY --chown=user . /app
# Run the FastAPI app using Uvicorn# Run the FastAPI app using Uvicorn on port 7860CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]Dockerfile+7-4