markitdown / Dockerfile
free-apis-collection's picture
Deploy 8b188a065eadac90c069eb2e3def7a2fffc189ff
c95b19e verified
Raw History Blame Contribute Delete
1.07 kB
# ChatCsv&Pdf-Backend
FROM python:3.11-slim AS builder
ENV PIP_DEFAULT_TIMEOUT=120 \
PIP_RETRIES=5 \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1
WORKDIR /build
COPY requirements.txt .
RUN pip install --no-cache-dir --prefix=/install \
--timeout=120 --retries=5 \
-r requirements.txt
FROM python:3.11-slim AS runtime
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
HF_HUB_DISABLE_SYMLINKS_WARNING=1
WORKDIR /app
# Runtime deps needed by some parsing libs (+ curl for HEALTHCHECK)
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
curl \
libgomp1 \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /install /usr/local
COPY . .
EXPOSE 7860
RUN mkdir -p /app/storage && chmod +x /app/start.sh
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:7860/ping')" || exit 1
CMD ["/bin/bash", "/app/start.sh"]