| |
| FROM python:3.9-slim |
|
|
| |
| ENV PYTHONUNBUFFERED=1 |
| ENV DEBIAN_FRONTEND=noninteractive |
| ENV PORT=7860 |
|
|
| |
| RUN apt-get update && apt-get install -y \ |
| tesseract-ocr \ |
| tesseract-ocr-eng \ |
| tesseract-ocr-fra \ |
| tesseract-ocr-deu \ |
| tesseract-ocr-spa \ |
| tesseract-ocr-ita \ |
| tesseract-ocr-por \ |
| tesseract-ocr-rus \ |
| tesseract-ocr-ara \ |
| tesseract-ocr-hin \ |
| libtesseract-dev \ |
| libgl1-mesa-glx \ |
| libglib2.0-0 \ |
| libsm6 \ |
| libxext6 \ |
| libxrender-dev \ |
| libgomp1 \ |
| libgcc-s1 \ |
| && apt-get clean \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| WORKDIR /app |
|
|
| |
| COPY requirements.txt . |
|
|
| |
| RUN pip install --no-cache-dir --upgrade pip && \ |
| pip install --no-cache-dir -r requirements.txt |
|
|
| |
| COPY . . |
|
|
| |
| RUN useradd -m -u 1000 user |
| RUN chown -R user:user /app |
| USER user |
|
|
| |
| EXPOSE 7860 |
|
|
| |
| HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ |
| CMD curl -f http://localhost:7860/health || exit 1 |
|
|
| |
| CMD ["python", "app.py"] |