Spaces:
Running
Running
File size: 771 Bytes
37f303a 42cbd9d 4d84d28 42cbd9d 4d84d28 42cbd9d 4d84d28 8a80e2d 42cbd9d 4d84d28 ee7c50d 37f303a ee7c50d 42cbd9d 4d84d28 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# 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 |