4
4
# For more information about the base image: https://mcr.microsoft.com/en-us/artifact/mar/devcontainers/python/about
5
5
FROM mcr.microsoft.com/devcontainers/python:3.10-bookworm
6
6
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
+
7
17
# default graphrag version will be 0.0.0 unless overridden by --build-arg
8
18
ARG GRAPHRAG_VERSION=0.0.0
9
19
ENV GRAPHRAG_VERSION=v${GRAPHRAG_VERSION}
@@ -12,6 +22,9 @@ ENV PIP_DISABLE_PIP_VERSION_CHECK=1
12
22
ENV SETUPTOOLS_USE_DISTUTILS=stdlib
13
23
ENV TIKTOKEN_CACHE_DIR=/opt/tiktoken_cache/
14
24
25
+ # CVE finding in pip < 23.3 - Upgrade pip to version 23.3 or greater
26
+ RUN pip install --upgrade pip
27
+
15
28
COPY backend /backend
16
29
RUN cd backend \
17
30
&& pip install poetry \
@@ -23,6 +36,9 @@ RUN python -c "import nltk;nltk.download(['punkt','averaged_perceptron_tagger','
23
36
# download tiktoken model encodings
24
37
RUN python -c "import tiktoken; tiktoken.encoding_for_model('gpt-3.5-turbo'); tiktoken.encoding_for_model('gpt-4'); tiktoken.encoding_for_model('gpt-4o');"
25
38
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
+
26
42
WORKDIR /backend
27
43
EXPOSE 80
28
44
CMD ["uvicorn", "graphrag_app.main:app", "--host", "0.0.0.0", "--port", "80"]
0 commit comments