From 69e9aa205a3fb2f6d7c3b285ab891f5218ceb61f Mon Sep 17 00:00:00 2001 From: Juha Louhiranta Date: Tue, 24 Sep 2024 15:16:23 +0300 Subject: [PATCH] fix: uwsgi has version mismatches with precompiled python libs lxml and xmlsec were installed as prebuilt python wheels. This caused version mismatch with uwsgi which was built against xmlsec1 and libxml2 libraries installed in the Dockerfile. lxml and xmlsec will now be compiled against the same libraries as uwsgi to avoid version mismatch issue. Refs: HP-2655 --- Dockerfile | 8 ++++++++ requirements-dev.txt | 3 +++ requirements-prod.txt | 3 +++ requirements.in | 3 +++ requirements.txt | 3 +++ 5 files changed, 20 insertions(+) diff --git a/Dockerfile b/Dockerfile index a82fc5dd..f5d0b322 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,6 +9,8 @@ FROM helsinkitest/python-node:3.9-14-slim AS staticbuilder RUN apt-install.sh \ libxmlsec1-dev \ libxml2-dev \ + libxslt-dev \ + zlib1g-dev \ pkg-config \ git \ curl \ @@ -48,6 +50,8 @@ RUN apt-install.sh \ git \ libxmlsec1-dev \ libxml2-dev \ + libxslt-dev \ + zlib1g-dev \ netcat-openbsd \ pkg-config \ && pip install -U pip setuptools wheel \ @@ -75,6 +79,10 @@ RUN python manage.py compilemessages FROM appbase AS development # ========================= +USER root +RUN apt-install.sh build-essential +USER appuser + COPY --chown=appuser:appuser requirements-dev.txt /app/requirements-dev.txt RUN pip install --no-cache-dir -r /app/requirements-dev.txt diff --git a/requirements-dev.txt b/requirements-dev.txt index 53e3bd7d..0672412f 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,6 +4,9 @@ # # pip-compile --strip-extras requirements-dev.in # +--no-binary lxml +--no-binary xmlsec + argparse==1.4.0 # via unittest2 build==1.2.1 diff --git a/requirements-prod.txt b/requirements-prod.txt index 8cba0153..bdeb8a78 100644 --- a/requirements-prod.txt +++ b/requirements-prod.txt @@ -4,5 +4,8 @@ # # pip-compile --strip-extras requirements-prod.in # +--no-binary lxml +--no-binary xmlsec + uwsgi==2.0.26 # via -r requirements-prod.in diff --git a/requirements.in b/requirements.in index b3ecf396..013c4834 100644 --- a/requirements.in +++ b/requirements.in @@ -1,3 +1,6 @@ +--no-binary xmlsec +--no-binary lxml + django<5.0 django-multiselectfield django-oauth-toolkit<=2.0 diff --git a/requirements.txt b/requirements.txt index 84c13882..e16d798a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,6 +4,9 @@ # # pip-compile --strip-extras requirements.in # +--no-binary lxml +--no-binary xmlsec + aiohttp==3.9.5 # via geoip2 aiosignal==1.3.1