quivr/backend/Dockerfile
Stan Girard b767f19f28
feat(assistant): cdp (#3305)
# Description

Please include a summary of the changes and the related issue. Please
also include relevant motivation and context.

## Checklist before requesting a review

Please delete options that are not relevant.

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented hard-to-understand areas
- [ ] I have ideally added tests that prove my fix is effective or that
my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged

## Screenshots (if appropriate):

---------

Co-authored-by: Zewed <dewez.antoine2@gmail.com>
2024-10-03 06:46:59 -07:00

66 lines
2.2 KiB
Docker

FROM python:3.11.6-slim-bullseye
WORKDIR /app
# Install runtime dependencies
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 \
wget \
# Additional dependencies for document handling
libmagic-dev \
poppler-utils \
tesseract-ocr \
libreoffice \
libpq-dev \
gcc \
libhdf5-serial-dev \
pandoc && \
rm -rf /var/lib/apt/lists/* && apt-get clean
# Install Supabase CLI
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
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 worker/diff-assistant/pyproject.toml worker/diff-assistant/README.md ./worker/diff-assistant/
COPY worker/diff-assistant/quivr_diff_assistant/__init__.py ./worker/diff-assistant/quivr_diff_assistant/__init__.py
COPY core/MegaParse/pyproject.toml core/MegaParse/README.md ./core/MegaParse/
COPY core/MegaParse/megaparse/__init__.py ./core/MegaParse/megaparse/__init__.py
RUN PYTHONDONTWRITEBYTECODE=1 pip install --no-cache-dir -r requirements.lock
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')"
ENV PYTHONPATH=/app
COPY . .
EXPOSE 5050