# Matrx Files — standalone microservice image.
#
# Installs ENTIRELY from PyPI (all matrx-* deps are published; a bare
# `uv pip install matrx-files[standalone]` is proven by the independence
# gate + a PyPI-only boot test). Build from anywhere:
#   docker build -t matrx-files packages/matrx-files
# Pin the version at build time for reproducible deploys:
#   docker build --build-arg MATRX_FILES_VERSION==0.1.0 -t matrx-files:0.1.0 packages/matrx-files
FROM python:3.13-slim

# tesseract: pytesseract OCR backend (same binary the CI gate installs).
RUN apt-get update -qq && apt-get install -y -qq --no-install-recommends \
    tesseract-ocr \
    && rm -rf /var/lib/apt/lists/*

RUN pip install --no-cache-dir uv

ARG MATRX_FILES_VERSION=""
RUN uv pip install --system "matrx-files[standalone]${MATRX_FILES_VERSION}"

ENV MATRX_FILES_BASE_DIR=/data/matrx-files
EXPOSE 8080
CMD ["uvicorn", "matrx_files.standalone.app:create_app", "--factory", "--host", "0.0.0.0", "--port", "8080"]
