# Build context is the repo root (see docker-compose.yml) so the sibling # packages Core/, Persistance/, Extraction/, models/, indicadores_kit/ and # Orquestacion/ can be copied. FROM python:3.12-slim # Tesseract (with Spanish data) for scanned documents; pytesseract only wraps the binary. RUN apt-get update && apt-get install -y --no-install-recommends \ tesseract-ocr tesseract-ocr-spa \ && rm -rf /var/lib/apt/lists/* RUN pip install --no-cache-dir uv WORKDIR /app COPY Core/ Core/ COPY Persistance/ Persistance/ COPY Extraction/ Extraction/ COPY models/ models/ COPY indicadores_kit/ indicadores_kit/ COPY Orquestacion/ Orquestacion/ COPY WebApi/ WebApi/ # Migrations need the MySQL/PostgreSQL drivers when *_DATABASE_URL points there. RUN cd Persistance && uv sync --no-dev --extra drivers # Drivers for the SQL import sources (MySQL/MariaDB, PostgreSQL, SQL Server). RUN cd WebApi && uv sync --no-dev --extra sql-drivers # The indicator pipeline (staging -> facts -> reports), run with # `python -m orquestacion ciclo ...` after an import. RUN cd Orquestacion && uv sync --no-dev --extra drivers ENV CACU_DATABASE_URL=sqlite:////data/cacu.db ENV CAMA_DATABASE_URL=sqlite:////data/cama.db ENV TEA_DATABASE_URL=sqlite:////data/tea.db ENV GOVERNANCE_DATABASE_URL=sqlite:////data/governance.db ENV MODELS_ARTIFACT_ROOT=/data/artifacts RUN chmod +x /app/WebApi/docker-entrypoint.sh EXPOSE 5000 ENTRYPOINT ["/app/WebApi/docker-entrypoint.sh"]