# Use same base Python image as lms_service FROM python:3.10-slim-bullseye # Set working directory WORKDIR /app # Copy requirements COPY requirements.txt . # Disable pip progress bar RUN pip config --user set global.progress_bar off # Build-time args for private repo (same as LMS) ARG BITBUCKET_USER ARG BITBUCKET_PASS # Install system dependencies AND Tesseract RUN apt-get update && \ apt-get install -y git libgl1 libsm6 libxrender1 libxext6 \ tesseract-ocr tesseract-ocr-eng && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* # Install Python dependencies RUN pip install --no-cache-dir -r requirements.txt && \ pip install --no-cache-dir \ git+https://${BITBUCKET_USER}:${BITBUCKET_PASS}@bitbucket.org/credit_fair/python-core.git@dev#subdirectory=utils # Copy the application code COPY . . # Environment variable to avoid OpenBLAS threading issues (common with numpy/OpenCV) ENV OPENBLAS_NUM_THREADS=1 # Expose port for FastAPI EXPOSE 8000 # Run the FastAPI app CMD ["uvicorn", "app_ocr:app", "--host", "0.0.0.0", "--port", "8000", "--log-level", "info", "--workers", "1", "--limit-concurrency", "10"]