44# For more information about the base image: https://mcr.microsoft.com/en-us/artifact/mar/devcontainers/python/about
55FROM mcr.microsoft.com/devcontainers/python:3.10-bookworm
66
7+ # Patch Debian to remediate CVE findings
8+ # Apply Debian bookworm-updates by running a full system upgrade
9+ RUN echo "deb http://deb.debian.org/debian bookworm-updates main" >> /etc/apt/sources.list.d/bookworm-updates.list \
10+ && echo "deb http://deb.debian.org/debian bookworm-backports main" >> /etc/apt/sources.list.d/backports.list \
11+ && apt-get update \
12+ && apt-get upgrade -y \
13+ && apt-get autoremove -y \
14+ && apt-get clean \
15+ && rm -rf /var/lib/apt/lists/*
16+
717# default graphrag version will be 0.0.0 unless overridden by --build-arg
818ARG GRAPHRAG_VERSION=0.0.0
919ENV GRAPHRAG_VERSION=v${GRAPHRAG_VERSION}
@@ -12,6 +22,9 @@ ENV PIP_DISABLE_PIP_VERSION_CHECK=1
1222ENV SETUPTOOLS_USE_DISTUTILS=stdlib
1323ENV TIKTOKEN_CACHE_DIR=/opt/tiktoken_cache/
1424
25+ # CVE finding in pip < 23.3 - Upgrade pip to version 23.3 or greater
26+ RUN pip install --upgrade pip
27+
1528COPY backend /backend
1629RUN cd backend \
1730 && pip install poetry \
@@ -23,6 +36,9 @@ RUN python -c "import nltk;nltk.download(['punkt','averaged_perceptron_tagger','
2336# download tiktoken model encodings
2437RUN python -c "import tiktoken; tiktoken.encoding_for_model('gpt-3.5-turbo'); tiktoken.encoding_for_model('gpt-4'); tiktoken.encoding_for_model('gpt-4o');"
2538
39+ # CVE finding in cryptography <= 44.0.0 - cache version 44.0.1 of cryptography via pip
40+ RUN pip install cryptography==44.0.1
41+
2642WORKDIR /backend
2743EXPOSE 80
2844CMD ["uvicorn", "graphrag_app.main:app", "--host", "0.0.0.0", "--port", "80"]
0 commit comments