mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-15 01:21:48 +03:00
380cf82706
# Description # Testing backend ## Docker setup 1. Copy `.env.example` to `.env`. Some env variables were added : EMBEDDING_DIM 2. Apply supabase migratrions : ```sh supabase stop supabase db reset supabase start ``` 3. Start backend containers ``` make dev ``` ## Local setup You can also run backend without docker. 1. Install [`rye`](https://rye.astral.sh/guide/installation/). Choose the managed python version and set the version to 3.11 2. Run the following: ``` cd quivr/backend rye sync ``` 3. Source `.venv` virtual env : `source .venv/bin/activate` 4. Run the backend, make sure you are running redis and supabase API: ``` LOG_LEVEL=debug uvicorn quivr_api.main:app --log-level debug --reload --host 0.0.0.0 --port 5050 --workers 1 ``` Worker: ``` LOG_LEVEL=debug celery -A quivr_worker.celery_worker worker -l info -E --concurrency 1 ``` Notifier: ``` LOG_LEVEL=debug python worker/quivr_worker/celery_monitor.py ``` --------- Co-authored-by: chloedia <chloedaems0@gmail.com> Co-authored-by: aminediro <aminedirhoussi1@gmail.com> Co-authored-by: Antoine Dewez <44063631+Zewed@users.noreply.github.com> Co-authored-by: Chloé Daems <73901882+chloedia@users.noreply.github.com> Co-authored-by: Zewed <dewez.antoine2@gmail.com>
46 lines
1.4 KiB
Docker
46 lines
1.4 KiB
Docker
# Using a slim version for a smaller base image
|
|
FROM python:3.11.6-slim-bullseye
|
|
|
|
WORKDIR /app
|
|
# 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
|
|
|
|
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
|
|
|
|
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')"
|
|
|
|
COPY . .
|
|
|
|
EXPOSE 5050
|