From c02d7bad93baddd3c3e38c02203cfe67184524bd Mon Sep 17 00:00:00 2001 From: Richard Pryce Date: Wed, 19 Jul 2023 12:16:47 +0100 Subject: [PATCH] Upgrade base image --- Dockerfile | 27 ++++++++++++++++++++++----- requirements.txt | 2 +- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2aa88c2..c901f48 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,31 @@ -FROM python:3.9-alpine3.12 +FROM python:3.9-bookworm COPY requirements.txt /opt/pluto-userbeacon/requirements.txt WORKDIR /opt/pluto-userbeacon -RUN apk add --no-cache alpine-sdk linux-headers libffi libffi-dev openssl-dev && pip install -r requirements.txt && apk --no-cache del alpine-sdk linux-headers libffi-dev + +# Update package list and install dependencies using apt-get +RUN apt-get update && apt-get install -y \ + build-essential \ + libffi-dev \ + libssl-dev \ + && pip install -r requirements.txt \ + && apt-get remove -y \ + build-essential \ + libffi-dev \ + && apt-get autoremove -y \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + RUN pip install -r requirements.txt + ADD userbeacon /opt/pluto-userbeacon/userbeacon ADD k8s_settings /opt/pluto-userbeacon/k8s_settings -#annoying, but until my Mac gets upgraded to support later Docker I can't use chown-in-copy :( + +# The chown command remains unchanged RUN chown -R nobody /opt/pluto-userbeacon + ENV PYTHONPATH=/opt/pluto-userbeacon -WORKDIR /opt/pluto-userbeacon + USER nobody -CMD uwsgi --http :9000 --enable-threads -L --module userbeacon.wsgi --buffer-size=8192 \ No newline at end of file +CMD uwsgi --http :9000 --enable-threads -L --module userbeacon.wsgi --buffer-size=8192 + diff --git a/requirements.txt b/requirements.txt index 6bdb463..fd19632 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ Django==3.2.15 -uWSGI==2.0.18 +uWSGI==2.0.21 requests==2.25.1 PyJWT==2.4.0 cryptography==3.3.2