math-solver / Dockerfile.worker.ocr
Cuong2004
Deploy API from GitHub Actions
395651c
raw
history blame contribute delete
934 Bytes
# Celery worker: OCR queue only (no Manim / LaTeX / Cairo stack).
FROM python:3.11-slim-bookworm
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=1 \
PIP_ROOT_USER_ACTION=ignore \
NO_ALBUMENTATIONS_UPDATE=1 \
OMP_NUM_THREADS=1 \
MKL_NUM_THREADS=1 \
OPENBLAS_NUM_THREADS=1
WORKDIR /app
ENV PYTHONPATH=/app
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
cmake \
pkg-config \
python3-dev \
libglib2.0-0 \
libgomp1 \
libgl1 \
libsm6 \
libxext6 \
libxrender1 \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.worker-ocr.txt .
RUN pip install --upgrade pip setuptools wheel \
&& pip install -r requirements.worker-ocr.txt
COPY . .
RUN python scripts/prewarm_ocr_worker.py
ENV PORT=7860 \
CELERY_WORKER_QUEUES=ocr
EXPOSE 7860
ENTRYPOINT []
CMD ["sh", "-c", "exec python3 -u worker_health.py"]