2024-06-28 19:09:17 +03:00
|
|
|
FROM python:3.11.6-slim-bullseye
|
2023-06-01 17:01:27 +03:00
|
|
|
|
2024-09-02 11:20:53 +03:00
|
|
|
WORKDIR /app
|
2023-10-09 16:23:13 +03:00
|
|
|
|
2024-09-02 11:20:53 +03:00
|
|
|
# Install runtime dependencies
|
2024-09-30 13:26:50 +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 \
|
|
|
|
curl \
|
2023-09-14 12:56:59 +03:00
|
|
|
git \
|
2024-09-30 13:26:50 +03:00
|
|
|
autoconf \
|
|
|
|
automake \
|
|
|
|
build-essential \
|
|
|
|
libtool \
|
|
|
|
python-dev \
|
|
|
|
build-essential \
|
2024-09-30 13:42:51 +03:00
|
|
|
wget \
|
2024-09-30 13:26:50 +03:00
|
|
|
# Additional dependencies for document handling
|
|
|
|
libmagic-dev \
|
2023-11-22 19:26:11 +03:00
|
|
|
poppler-utils \
|
|
|
|
tesseract-ocr \
|
2024-02-13 06:56:20 +03:00
|
|
|
libreoffice \
|
2024-02-15 07:29:57 +03:00
|
|
|
libpq-dev \
|
|
|
|
gcc \
|
2024-09-30 13:26:50 +03:00
|
|
|
pandoc && \
|
|
|
|
rm -rf /var/lib/apt/lists/* && apt-get clean
|
2023-08-25 12:05:24 +03:00
|
|
|
|
2024-09-02 11:20:53 +03:00
|
|
|
# Install Supabase CLI
|
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; \
|
2024-09-02 11:20:53 +03:00
|
|
|
fi
|
2024-06-27 14:02:15 +03:00
|
|
|
|
2024-09-30 13:26:50 +03:00
|
|
|
COPY requirements.lock pyproject.toml README.md ./
|
|
|
|
COPY api/pyproject.toml api/README.md ./api/
|
|
|
|
COPY api/quivr_api/__init__.py ./api/quivr_api/__init__.py
|
|
|
|
COPY core/pyproject.toml core/README.md ./core/
|
|
|
|
COPY core/quivr_core/__init__.py ./core/quivr_core/__init__.py
|
|
|
|
COPY worker/pyproject.toml worker/README.md ./worker/
|
|
|
|
COPY worker/quivr_worker/__init__.py ./worker/quivr_worker/__init__.py
|
|
|
|
COPY core/MegaParse/pyproject.toml core/MegaParse/README.md ./core/MegaParse/
|
|
|
|
COPY core/MegaParse/megaparse/__init__.py ./core/MegaParse/megaparse/__init__.py
|
2024-06-27 15:02:10 +03:00
|
|
|
|
2024-09-02 11:20:53 +03:00
|
|
|
RUN PYTHONDONTWRITEBYTECODE=1 pip install --no-cache-dir -r requirements.lock
|
2023-05-21 02:20:55 +03:00
|
|
|
|
2024-09-02 11:20:53 +03:00
|
|
|
RUN playwright install --with-deps && \
|
|
|
|
python -c "from unstructured.nlp.tokenize import download_nltk_packages; download_nltk_packages()" && \
|
|
|
|
python -c "import nltk;nltk.download('punkt_tab'); nltk.download('averaged_perceptron_tagger_eng')"
|
2024-06-26 10:58:55 +03:00
|
|
|
|
2023-11-13 12:13:56 +03:00
|
|
|
|
2024-09-02 11:20:53 +03:00
|
|
|
ENV PYTHONPATH=/app
|
2023-05-21 02:20:55 +03:00
|
|
|
|
2024-09-30 13:26:50 +03:00
|
|
|
COPY . .
|
2023-11-18 21:23:56 +03:00
|
|
|
EXPOSE 5050
|