2022-09-12 16:33:56 +02:00
|
|
|
ARG build_image
|
2023-01-27 09:48:05 +01:00
|
|
|
ARG base_image
|
2022-09-12 16:33:56 +02:00
|
|
|
|
|
|
|
FROM $build_image AS build-image
|
|
|
|
|
2022-12-30 11:34:27 +01:00
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
2022-09-12 16:33:56 +02:00
|
|
|
ARG haystack_version
|
|
|
|
|
2023-02-20 18:40:30 +01:00
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install -y --no-install-recommends \
|
2023-02-21 16:37:33 +01:00
|
|
|
build-essential \
|
2023-12-04 12:52:58 +01:00
|
|
|
git
|
2023-02-20 18:40:30 +01:00
|
|
|
|
2022-09-12 16:33:56 +02:00
|
|
|
# Shallow clone Haystack repo, we'll install from the local sources
|
|
|
|
RUN git clone --depth=1 --branch=${haystack_version} https://github.com/deepset-ai/haystack.git /opt/haystack
|
|
|
|
WORKDIR /opt/haystack
|
|
|
|
|
|
|
|
# Use a virtualenv we can copy over the next build stage
|
2022-12-30 11:34:27 +01:00
|
|
|
RUN python3 -m venv --system-site-packages /opt/venv
|
2022-09-12 16:33:56 +02:00
|
|
|
ENV PATH="/opt/venv/bin:$PATH"
|
|
|
|
|
2024-02-23 16:58:39 +01:00
|
|
|
# Upgrade setuptools due to https://nvd.nist.gov/vuln/detail/CVE-2022-40897
|
2022-09-12 16:33:56 +02:00
|
|
|
RUN pip install --upgrade pip && \
|
2024-02-23 16:58:39 +01:00
|
|
|
pip install --no-cache-dir -U setuptools && \
|
2023-12-04 12:52:58 +01:00
|
|
|
pip install --no-cache-dir .
|
2023-01-02 17:06:24 +01:00
|
|
|
|
2023-01-27 09:48:05 +01:00
|
|
|
FROM $base_image AS final
|
2022-09-12 16:33:56 +02:00
|
|
|
|
|
|
|
COPY --from=build-image /opt/venv /opt/venv
|
2023-03-31 14:37:05 +02:00
|
|
|
COPY --from=deepset/xpdf:latest /opt/pdftotext /usr/local/bin
|
|
|
|
|
|
|
|
# pdftotext requires fontconfig runtime
|
|
|
|
RUN apt-get update && apt-get install -y libfontconfig && rm -rf /var/lib/apt/lists/*
|
2022-09-12 16:33:56 +02:00
|
|
|
|
|
|
|
ENV PATH="/opt/venv/bin:$PATH"
|