34 lines
1.2 KiB
Docker
34 lines
1.2 KiB
Docker
# Build context is the repo root (see docker-compose.yml) so the sibling
|
|
# packages Core/, Persistance/, Extraction/ and models/ 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 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
|
|
|
|
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"]
|