mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-09-11 14:36:35 +03:00
# Description closes #2722. - Creates `quivr-monorepo` - Separates `quivr-core` - Update dockerfiles and docker-compose --------- Co-authored-by: aminediro <aminediro@github.com>
63 lines
1.6 KiB
Docker
63 lines
1.6 KiB
Docker
# Using a slim version for a smaller base image
|
|
FROM python:3.11.6-slim-bullseye
|
|
|
|
ARG DEV_MODE
|
|
ENV DEV_MODE=$DEV_MODE
|
|
|
|
# Install GEOS library, Rust, and other dependencies, then clean up
|
|
RUN apt-get clean && apt-get update && apt-get install -y \
|
|
libgeos-dev \
|
|
libcurl4-openssl-dev \
|
|
libssl-dev \
|
|
binutils \
|
|
curl \
|
|
git \
|
|
autoconf \
|
|
automake \
|
|
build-essential \
|
|
libtool \
|
|
python-dev \
|
|
build-essential \
|
|
# Additional dependencies for document handling
|
|
libmagic-dev \
|
|
poppler-utils \
|
|
tesseract-ocr \
|
|
libreoffice \
|
|
libpq-dev \
|
|
gcc \
|
|
pandoc && \
|
|
rm -rf /var/lib/apt/lists/* && apt-get clean
|
|
|
|
# TODO(@aminediro) : multistage build. Probably dont neet poetry once its built
|
|
# Install Poetry
|
|
RUN curl -sSL https://install.python-poetry.org | POETRY_HOME=/opt/poetry python && \
|
|
cd /usr/local/bin && \
|
|
ln -s /opt/poetry/bin/poetry && \
|
|
poetry config virtualenvs.create false
|
|
|
|
# Add Rust binaries to the PATH
|
|
ENV PATH="/root/.cargo/bin:${PATH}" \
|
|
POETRY_CACHE_DIR=/tmp/poetry_cache \
|
|
PYTHONDONTWRITEBYTECODE=1
|
|
|
|
WORKDIR /code
|
|
|
|
# Copy monorepo dependencies
|
|
# CORE
|
|
COPY core/pyproject.toml core/README.md core/poetry.lock /code/core/
|
|
COPY core/quivr_core /code/core/quivr_core
|
|
# API
|
|
COPY api/pyproject.toml api/poetry.lock api/README.md /code/api/
|
|
COPY api/quivr_api /code/api/quivr_api
|
|
COPY ./pyproject.toml ./poetry.lock* /code/
|
|
|
|
# Run install
|
|
RUN poetry install --no-root --with dev,test && \
|
|
playwright install --with-deps && \
|
|
rm -rf $POETRY_CACHE_DIR
|
|
|
|
|
|
ENV PYTHONPATH=/code
|
|
|
|
EXPOSE 5050
|