Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files12124563458910116789101314111213141617181920151617182219202122252623242528293031322627# Use Python 3.10 slim image as baseFROM python:3.10-slimFROM python:3.9
# Create non-root userRUN useradd -m -u 1000 userRUN apt-get update && apt-get install -y git# Switch to root for system installationsUSER root
# Set environment variablesENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH \ PORT=7860# Install Tesseract and language dataRUN apt-get update && apt-get install -y \ git \ && rm -rf /var/lib/apt/lists/*
# Create and set working directoryWORKDIR $HOME/app# Create user and set up environmentRUN useradd -m -u 1000 user && \ chown -R user:user /usr/share/tesseract-ocr/4.00/tessdata
# Clone the repository and move files without creating an extra folderRUN git clone https://github.com/charan200415/FileToLink temp && \ shopt -s dotglob && \ mv temp/* ./ && \ rmdir tempRUN --mount=type=secret,id=Access_key,mode=0444,required=true \ git clone $(cat /run/secrets/Access_key) /appWORKDIR /app
# Switch to non-root user# Switch to user for pip installationsUSER userENV PATH="/home/user/.local/bin:$PATH"
# Install dependenciesRUN pip install --user -r requirements.txt# Install Python dependenciesRUN pip install --no-cache-dir --upgrade -r requirements.txt
# Expose portEXPOSE ${PORT}
# Command to run the applicationCMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--reload"]# Copy application filesCMD ["gunicorn", "-b", "0.0.0.0:7860", "--timeout", "300", "--workers", "2", "--threads", "4", "app:app"]Dockerfile+19-24