2023-11-13 17:03:55 +03:00
|
|
|
# Using a slim version for a smaller base image
|
2024-04-27 14:42:24 +03:00
|
|
|
FROM python:3.11.6-slim-bullseye@sha256:0c1fbb294096d842ad795ee232d783cab436c90b034210fe894f2bb2f2be7626 AS base
|
2023-06-01 17:01:27 +03:00
|
|
|
|
2023-10-09 16:23:13 +03:00
|
|
|
ARG DEV_MODE
|
|
|
|
ENV DEV_MODE=$DEV_MODE
|
|
|
|
|
2023-11-13 17:03:55 +03:00
|
|
|
# Install GEOS library, Rust, and other dependencies, then clean up
|
2024-04-28 15:34:44 +03:00
|
|
|
RUN apt-get clean && apt-get update && apt-get install -y \
|
2023-08-25 12:05:24 +03:00
|
|
|
libgeos-dev \
|
2023-09-14 12:56:59 +03:00
|
|
|
libcurl4-openssl-dev \
|
|
|
|
libssl-dev \
|
2023-08-25 12:05:24 +03:00
|
|
|
binutils \
|
2023-11-18 21:23:56 +03:00
|
|
|
pandoc \
|
2023-08-25 12:05:24 +03:00
|
|
|
curl \
|
2023-09-14 12:56:59 +03:00
|
|
|
git \
|
2023-11-22 19:26:11 +03:00
|
|
|
poppler-utils \
|
|
|
|
tesseract-ocr \
|
2024-01-26 02:56:46 +03:00
|
|
|
autoconf \
|
|
|
|
automake \
|
|
|
|
build-essential \
|
|
|
|
libtool \
|
|
|
|
python-dev \
|
2024-04-27 14:42:24 +03:00
|
|
|
wget \
|
2024-02-13 06:56:20 +03:00
|
|
|
# Additional dependencies for document handling
|
|
|
|
libmagic-dev \
|
|
|
|
poppler-utils \
|
|
|
|
tesseract-ocr \
|
|
|
|
libreoffice \
|
2024-02-15 07:29:57 +03:00
|
|
|
libpq-dev \
|
|
|
|
gcc \
|
2024-02-13 06:56:20 +03:00
|
|
|
pandoc && \
|
2024-04-27 14:42:24 +03:00
|
|
|
rm -rf /var/lib/apt/lists/*
|
2023-05-21 02:20:55 +03:00
|
|
|
|
2023-08-25 12:05:24 +03:00
|
|
|
|
2024-04-27 14:42:24 +03:00
|
|
|
RUN ARCHITECTURE=$(uname -m) && \
|
|
|
|
if [ "$ARCHITECTURE" = "x86_64" ]; then \
|
|
|
|
wget https://github.com/supabase/cli/releases/download/v1.163.6/supabase_1.163.6_linux_amd64.deb && \
|
|
|
|
dpkg -i supabase_1.163.6_linux_amd64.deb && \
|
|
|
|
rm supabase_1.163.6_linux_amd64.deb; \
|
|
|
|
elif [ "$ARCHITECTURE" = "aarch64" ]; then \
|
|
|
|
wget https://github.com/supabase/cli/releases/download/v1.163.6/supabase_1.163.6_linux_arm64.deb && \
|
|
|
|
dpkg -i supabase_1.163.6_linux_arm64.deb && \
|
|
|
|
rm supabase_1.163.6_linux_arm64.deb; \
|
|
|
|
fi && \
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
2024-06-26 10:58:55 +03:00
|
|
|
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
|
|
|
|
|
2023-05-21 02:20:55 +03:00
|
|
|
WORKDIR /code
|
|
|
|
|
2024-06-27 13:51:01 +03:00
|
|
|
|
|
|
|
# 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
|
|
|
|
|
2024-06-26 10:58:55 +03:00
|
|
|
COPY ./pyproject.toml ./poetry.lock* /code/
|
|
|
|
|
|
|
|
# Run install
|
|
|
|
RUN poetry install --no-root && \
|
|
|
|
playwright install --with-deps && \
|
|
|
|
rm -rf $POETRY_CACHE_DIR
|
2023-05-21 02:20:55 +03:00
|
|
|
|
2024-06-26 10:58:55 +03:00
|
|
|
|
|
|
|
ENV PYTHONPATH=/code
|
2023-11-13 12:13:56 +03:00
|
|
|
|
2023-05-21 02:20:55 +03:00
|
|
|
|
2023-11-18 21:23:56 +03:00
|
|
|
EXPOSE 5050
|