chore: Be explicit on extras to install in Docker (#598)
<!-- .github/pull_request_template.md --> ## Description Be explicit on extras to install in Docker. ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a configurable option to install only selected dependency extras, allowing for a more tailored build experience. - **Chores** - Improved clarity in the build instructions regarding environment configuration. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
parent
3e93dbe264
commit
7bac2303cc
1 changed files with 18 additions and 6 deletions
24
Dockerfile
24
Dockerfile
|
|
@ -1,5 +1,20 @@
|
||||||
FROM python:3.11-slim
|
FROM python:3.11-slim
|
||||||
|
|
||||||
|
# Define Poetry extras to install
|
||||||
|
ARG POETRY_EXTRAS="\
|
||||||
|
# Storage & Databases \
|
||||||
|
filesystem postgres weaviate qdrant neo4j falkordb milvus \
|
||||||
|
# Notebooks & Interactive Environments \
|
||||||
|
notebook \
|
||||||
|
# LLM & AI Frameworks \
|
||||||
|
langchain llama-index gemini huggingface ollama mistral groq \
|
||||||
|
# Evaluation & Monitoring \
|
||||||
|
deepeval evals posthog \
|
||||||
|
# Graph Processing & Code Analysis \
|
||||||
|
codegraph graphiti \
|
||||||
|
# Document Processing \
|
||||||
|
docs"
|
||||||
|
|
||||||
# Set build argument
|
# Set build argument
|
||||||
ARG DEBUG
|
ARG DEBUG
|
||||||
|
|
||||||
|
|
@ -14,19 +29,16 @@ RUN apt-get install -y \
|
||||||
gcc \
|
gcc \
|
||||||
libpq-dev
|
libpq-dev
|
||||||
|
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY pyproject.toml poetry.lock /app/
|
COPY pyproject.toml poetry.lock /app/
|
||||||
|
|
||||||
|
|
||||||
RUN pip install poetry
|
RUN pip install poetry
|
||||||
|
|
||||||
# Don't create virtualenv since docker is already isolated
|
# Don't create virtualenv since Docker is already isolated
|
||||||
RUN poetry config virtualenvs.create false
|
RUN poetry config virtualenvs.create false
|
||||||
|
|
||||||
# Install the dependencies
|
# Install the dependencies using the defined extras
|
||||||
RUN poetry install --all-extras --no-root --without dev
|
RUN poetry install --extras "${POETRY_EXTRAS}" --no-root --without dev
|
||||||
|
|
||||||
|
|
||||||
# Set the PYTHONPATH environment variable to include the /app directory
|
# Set the PYTHONPATH environment variable to include the /app directory
|
||||||
ENV PYTHONPATH=/app
|
ENV PYTHONPATH=/app
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue