| FROM python:3.10-slim |
|
|
| |
| RUN apt-get update && apt-get install -y \ |
| tesseract-ocr \ |
| tesseract-ocr-mar \ |
| tesseract-ocr-hin \ |
| poppler-utils \ |
| libgl1 \ |
| libglx-mesa0 \ |
| libglib2.0-0 \ |
| git \ |
| build-essential \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| WORKDIR /app |
|
|
| COPY requirements.txt . |
|
|
| |
| RUN pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cpu |
|
|
| |
| RUN FORCE_CUDA=0 pip install --no-cache-dir 'git+https://github.com/facebookresearch/detectron2.git' |
|
|
| |
| RUN pip install --no-cache-dir -r requirements.txt |
|
|
| COPY . . |
|
|
| |
| RUN useradd -m -u 1000 user |
| USER user |
| ENV HOME=/home/user \ |
| PATH=/home/user/.local/bin:$PATH |
|
|
| CMD ["python", "app.py"] |
|
|