Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files12345671 unmodified line91011121314151617181920# Use Python 3.9 as the base imageFROM python:3.9# Create a user to avoid running as rootRUN useradd -m -u 1000 userUSER userENV PATH="/home/user/.local/bin:$PATH"1 unmodified line# Set the working directoryWORKDIR /app# Copy dependencies and install themCOPY --chown=user ./requirements.txt requirements.txtRUN pip install --no-cache-dir --upgrade -r requirements.txt# Copy the app codeCOPY --chown=user . /app# Run the FastAPI app using UvicornCMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]123456789101 unmodified line121314151617181920212223# Use Python 3.9 as the base imageFROM python:3.9# 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 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 source codeCOPY --chown=user . /app# Run the FastAPI app using Uvicorn on port 7860CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
Dockerfile+7-4