Skip to content

Commit

Permalink
fix: uwsgi has version mismatches with precompiled python libs
Browse files Browse the repository at this point in the history
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
  • Loading branch information
charn committed Sep 24, 2024
1 parent 4a3e2f6 commit 69e9aa2
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions requirements-prod.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
--no-binary xmlsec
--no-binary lxml

django<5.0
django-multiselectfield
django-oauth-toolkit<=2.0
Expand Down
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 69e9aa2

Please sign in to comment.