| |
| FROM python:3.11-slim |
|
|
| |
| WORKDIR /app |
|
|
| |
| |
| |
| |
| RUN apt-get update && apt-get install -y \ |
| tesseract-ocr \ |
| tesseract-ocr-eng \ |
| tesseract-ocr-deu \ |
| tesseract-ocr-fra \ |
| tesseract-ocr-spa \ |
| tesseract-ocr-por \ |
| tesseract-ocr-ita \ |
| tesseract-ocr-rus \ |
| tesseract-ocr-chi-sim \ |
| tesseract-ocr-jpn \ |
| tesseract-ocr-kor \ |
| poppler-utils \ |
| libgl1 \ |
| libglib2.0-0 \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| COPY requirements.txt . |
| RUN pip install --upgrade pip setuptools wheel \ |
| && pip install --default-timeout=100 --retries=10 --no-cache-dir -r requirements.txt |
|
|
| |
| COPY . . |
|
|
| |
| RUN useradd -m appuser && chown -R appuser /app |
| USER appuser |
|
|
| |
| HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \ |
| CMD python -c "import requests; requests.get('http://localhost:8000/api/v1/ping', timeout=5)" || exit 1 |
|
|
| |
| CMD ["python", "main.py"] |