Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HP-2655 | fix: uwsgi has version mismatches with precompiled python libs #315

Merged
merged 2 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 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,17 +50,19 @@ RUN apt-install.sh \
git \
libxmlsec1-dev \
libxml2-dev \
libxslt-dev \
zlib1g-dev \
netcat-openbsd \
pkg-config \
&& pip install -U pip setuptools wheel \
&& pip install --no-cache-dir -r /app/requirements.txt \
&& pip install --no-cache-dir -r /app/requirements-prod.txt \
&& UWSGI_PROFILE_OVERRIDE="ssl=false" pip install --no-cache-dir -r /app/requirements-prod.txt \
&& apt-cleanup.sh build-essential pkg-config

COPY docker-entrypoint.sh /app
ENTRYPOINT ["./docker-entrypoint.sh"]

# STore static files under /var to not conflict with development volume mount
# Store static files under /var to not conflict with development volume mount
ENV STATIC_ROOT /var/tunnistamo/static
ENV MEDIA_ROOT /var/tunnistamo/media
ENV NODE_MODULES_ROOT /var/tunnistamo/node_modules
Expand All @@ -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