Spaces:
Build error
Build error
Update Dockerfile
Browse files12345567891010111212131415161617181920212223242521262324272829303132333435362 unmodified lines3940413342FROM python:3.9
# Switch to root for system installationsUSER root
# Install Tesseract and language data# Install dependenciesRUN apt-get update && apt-get install -y \ git \ && rm -rf /var/lib/apt/lists/*
# Create user and set up environment# Create non-root userRUN useradd -m -u 1000 userUSER user
ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH \ PORT=7860# Clone the repository and set up directories
# Clone repository as rootRUN --mount=type=secret,id=Access_key,mode=0444,required=true \ git clone $(cat /run/secrets/Access_key) $HOME/app
# Ensure non-root user has ownership of the cloned filesRUN chown -R user:user $HOME/app
# Set working directory# Create and set working directoryWORKDIR $HOME/appRUN mkdir -p uploadsRUN mkdir -p temp
# Create necessary directories with correct permissionsRUN mkdir -p uploads temp && \ chown -R user:user uploads temp
# Switch to non-root userUSER user
# Install Python dependenciesRUN pip install --no-cache-dir --upgrade -r requirements.txt2 unmodified linesEXPOSE 7860
# Start the applicationCMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]Dockerfile+17-8