From f178be8395a95e5023756e2824efbadac2b44216 Mon Sep 17 00:00:00 2001 From: PCoder Date: Mon, 19 Feb 2024 20:42:34 +0530 Subject: [PATCH 1/5] Update .dockerignore: ignore .env --- .dockerignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.dockerignore b/.dockerignore index 6b8710a7..a715c9d7 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1 +1,2 @@ .git +.env From 893c8168469382426d59b93606baf2e1e6dc4520 Mon Sep 17 00:00:00 2001 From: PCoder Date: Mon, 19 Feb 2024 20:43:33 +0530 Subject: [PATCH 2/5] Add apks required for the build on alpine 3.12 --- Dockerfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d12c54ff..bee11218 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,12 @@ RUN apk add --update --no-cache \ build-base \ openldap-dev \ python3-dev \ - libpq-dev \ + postgresql-dev \ + jpeg-dev \ + libxml2-dev \ + libxslt-dev \ + libmemcached-dev \ + zlib-dev \ && rm -rf /var/cache/apk/* # FIX https://github.com/python-ldap/python-ldap/issues/432 From b6ff2b62c1da90a8a4c5bfebe10f6edb573d57fa Mon Sep 17 00:00:00 2001 From: PCoder Date: Mon, 19 Feb 2024 20:44:17 +0530 Subject: [PATCH 3/5] Add comment for alpine 3.14 requirement --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index bee11218..7b5440af 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,6 +16,8 @@ RUN apk add --update --no-cache \ zlib-dev \ && rm -rf /var/cache/apk/* +## For alpine 3.15 replace postgresql-dev with libpq-dev + # FIX https://github.com/python-ldap/python-ldap/issues/432 RUN echo 'INPUT ( libldap.so )' > /usr/lib/libldap_r.so From 8d13629c8b775c63cc8dd8fda7412c36fd09aefa Mon Sep 17 00:00:00 2001 From: PCoder Date: Mon, 19 Feb 2024 20:49:29 +0530 Subject: [PATCH 4/5] Use proper library path for Pillow --- Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7b5440af..395ebcc9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,5 +22,8 @@ RUN apk add --update --no-cache \ RUN echo 'INPUT ( libldap.so )' > /usr/lib/libldap_r.so COPY requirements.txt ./ -RUN pip install --no-cache-dir -r requirements.txt + +# Pillow seems to need LIBRARY_PATH set as follows: (see: https://github.com/python-pillow/Pillow/issues/1763#issuecomment-222383534) +RUN LIBRARY_PATH=/lib:/usr/lib /bin/sh -c "pip install --no-cache-dir -r requirements.txt" + COPY ./ . From 9e98125b13e400d0c083589b252527872fa58a56 Mon Sep 17 00:00:00 2001 From: PCoder Date: Mon, 19 Feb 2024 20:50:10 +0530 Subject: [PATCH 5/5] Use the same django-filer version being used on production --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 8d04a189..73cdf987 100644 --- a/requirements.txt +++ b/requirements.txt @@ -25,7 +25,7 @@ django-compressor==2.0 django-debug-toolbar==1.4 python-dotenv==0.10.3 django-extensions==1.6.7 -django-filer==2.1.2 +django-filer==1.2.0 django-filter==0.13.0 django-formtools==1.0 django-guardian==1.4.4