Spaces:
Sleeping
Sleeping
| # syntax=docker/dockerfile:1.4 | |
| FROM python:3.11-slim | |
| # install system deps… | |
| RUN apt-get update && \ | |
| apt-get install -y --no-install-recommends \ | |
| tesseract-ocr \ | |
| libgl1 \ | |
| ffmpeg && \ | |
| rm -rf /var/lib/apt/lists/* | |
| WORKDIR /app | |
| # create both cache dirs and make them world-writable | |
| RUN mkdir -p /data/.cache/huggingface && \ | |
| mkdir -p /data/.EasyOCR && \ | |
| chmod -R 777 /data/.cache /data/.EasyOCR | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| COPY . . | |
| # tell HF and EasyOCR to use those | |
| ENV PORT=7860 \ | |
| XDG_CACHE_HOME=/data/.cache \ | |
| TRANSFORMERS_CACHE=/data/.cache/huggingface \ | |
| HF_HOME=/data/.cache/huggingface | |
| EXPOSE ${PORT} | |
| CMD gunicorn wsgi:app -k gevent --timeout 300 --bind 0.0.0.0:$PORT |