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

Update docker base image, Django and Wagtail #766

Merged
merged 7 commits into from
Sep 12, 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
6 changes: 3 additions & 3 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ jobs:
while ! echo exit | nc localhost 5000; do sleep 10; done
- name: flake8 lint
run: docker compose -f docker-compose.dev.yml exec -T web make flake8
- name: pylint
run: docker compose -f docker-compose.dev.yml exec -T web make pylint
# - name: pylint
# run: docker compose -f docker-compose.dev.yml exec -T web make pylint
- name: pydocstyle lint
run: docker compose -f docker-compose.dev.yml exec -T web make pydocstyle
- name: pytest
Expand Down Expand Up @@ -192,7 +192,7 @@ jobs:
--log-driver 'json-file' \
--log-opt max-size=100m \
--log-opt max-file=3 \
-e DJANGO_SETTINGS_MODULE='iati.settings.dev' \
-e DJANGO_SETTINGS_MODULE='iati.settings.dev_public' \
-e SECRET_KEY='${{ secrets.DEV_SECRET_KEY }}' \
-e DATABASE_NAME='${{ secrets.DEV_DATABASE_NAME }}' \
-e DATABASE_USER='${{ secrets.DEV_DATABASE_USER }}' \
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.13.2
FROM alpine:3.20.2

ENV LANG en_US.UTF-8
ENV PYTHONUNBUFFERED 1
Expand Down Expand Up @@ -32,10 +32,9 @@ RUN apk add --no-cache python3 py3-pip && \
if [[ ! -e /usr/bin/python ]]; then ln -sf /usr/bin/python3 /usr/bin/python; fi


RUN apk add build-base libffi-dev libressl-dev && \
RUN apk add build-base libffi-dev && \
ln -sf /usr/bin/python3 /usr/bin/python && \
ln -sf /usr/bin/pip3 usr/bin/pip && \
This conversation was marked as resolved.
Show resolved Hide resolved
pip install --upgrade pip
ln -sf /usr/bin/pip3 usr/bin/pip

RUN apk add --no-cache jpeg-dev zlib-dev
RUN apk add --no-cache postgresql-dev
Expand Down Expand Up @@ -105,6 +104,7 @@ RUN apk -U upgrade
RUN apk add --no-cache gcc musl-dev python3-dev libffi-dev openssl-dev cargo libwebp libwebp-tools &&\
python3 -m venv /usr/src/venv &&\
. /usr/src/venv/bin/activate &&\
pip3 install --upgrade pip &&\
pip3 install -r requirements_dev.txt

RUN apk add --no-cache gettext
Expand Down
6 changes: 3 additions & 3 deletions common/templatetags/responsive.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ def render(self, context):
output_format = original_format
if output_format not in ['jpeg', 'png', 'gif', 'webp']:
output_format = 'webp'
if output_format != original_format and "format" not in self.filter_spec:
self.filter_spec = "{}|{}".format(self.filter_spec, "format-{}".format(output_format))
rendition = image.get_rendition(self.filter)
if output_format != original_format and not any("format" in x for x in self.filter_specs):
self.filter_specs = ["{}|{}".format(self.filter_specs, "format-{}".format(output_format))]
rendition = image.get_rendition(self.get_filter())
except SourceImageIOError:
# It's fairly routine for people to pull down remote databases to their
# local dev versions without retrieving the corresponding image files.
Expand Down
34 changes: 34 additions & 0 deletions iati/settings/dev_public.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"""Settings for the public dev environment (overrides base settings).

DEBUG is False etc. because the website is publicly accessible.
"""

import os
from .base import * # noqa: F401, F403 # pylint: disable=unused-wildcard-import, wildcard-import

DEBUG = False

# SECURITY WARNING: keep the secret key used in production secret!
# Overwrite this variable in local.py with another unguessable string.
SECRET_KEY = os.environ.get('SECRET_KEY')

EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'

ALLOWED_HOSTS = [
'0.0.0.0',
'iatistandard.org',
'.iatistandard.org',
]

SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')

SECURE_SSL_REDIRECT = not DEBUG
CSRF_COOKIE_SECURE = not DEBUG
SESSION_COOKIE_SECURE = not DEBUG

AZURE_ACCOUNT_NAME = os.getenv('AZURE_ACCOUNT_NAME')

try:
from .local import * # # noqa: F401, F403 # pylint: disable=unused-wildcard-import, wildcard-import
except ImportError:
pass
1 change: 0 additions & 1 deletion patterns/converted-html/assets/css/basic.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,22 @@ django-import-export
django-haystack
django-modeltranslation
django-prettyjson
django-recaptcha3
# Pull in a repo with a small fix to get Django 4.2 working
# See https://github.com/kbytesys/django-recaptcha3/issues/22#issuecomment-1848441795
django-recaptcha3 @ git+https://github.com/bartsanchez/django-recaptcha3.git@313509e40163ce381e7aa3decd1de1ed9f71d380
Bjwebb marked this conversation as resolved.
Show resolved Hide resolved
django-storages[azure]
django-widget-tweaks
Django>=3.2,<3.3
Django>=4.2,<4.3
elasticsearch>=6.8,<7
gunicorn
opencensus-ext-azure
opencensus-ext-django
PyGithub
psycopg2-binary
requests
tzdata
wagtail-modeltranslation
wagtail>=4.1,<4.2
wagtail>=5.2,<5.3
Wand
whitenoise
wrapt
55 changes: 29 additions & 26 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile requirements.in
Expand All @@ -16,12 +16,10 @@ azure-core==1.30.2
# opencensus-ext-azure
azure-identity==1.17.1
# via opencensus-ext-azure
azure-storage-blob==12.21.0
azure-storage-blob==12.22.0
# via django-storages
babel==2.15.0
babel==2.16.0
# via -r requirements.in
backports-zoneinfo==0.2.1
# via djangorestframework
beautifulsoup4==4.11.2
# via
# -r requirements.in
Expand All @@ -32,7 +30,7 @@ cachetools==5.4.0
# via google-auth
certifi==2024.7.4
# via requests
cffi==1.16.0
cffi==1.17.0
# via
# cryptography
# pynacl
Expand All @@ -52,11 +50,12 @@ diff-match-patch==20230430
# via django-import-export
dj-database-url==2.2.0
# via -r requirements.in
django==3.2.25
django==4.2.15
# via
# -r requirements.in
# dj-database-url
# django-appconf
# django-compressor
# django-extensions
# django-filter
# django-haystack
Expand All @@ -74,37 +73,37 @@ django==3.2.25
# wagtail-modeltranslation
django-appconf==1.0.6
# via django-compressor
django-compressor==4.4
django-compressor==4.5.1
# via -r requirements.in
django-extensions==3.2.3
# via -r requirements.in
django-filter==22.1
django-filter==23.5
# via wagtail
django-haystack==3.3.0
# via -r requirements.in
django-import-export==4.1.1
# via -r requirements.in
django-modelcluster==6.3
# via wagtail
django-modeltranslation==0.18.11
django-modeltranslation==0.19.7
# via
# -r requirements.in
# wagtail-modeltranslation
django-permissionedforms==0.1
# via wagtail
django-prettyjson==0.4.1
# via -r requirements.in
django-recaptcha3==0.4.0
django-recaptcha3 @ git+https://github.com/bartsanchez/django-recaptcha3.git@313509e40163ce381e7aa3decd1de1ed9f71d380
# via -r requirements.in
django-storages[azure]==1.14.4
# via -r requirements.in
django-taggit==3.1.0
django-taggit==4.0.0
# via wagtail
django-treebeard==4.7.1
# via wagtail
django-widget-tweaks==1.5.0
# via -r requirements.in
djangorestframework==3.15.1
djangorestframework==3.15.2
# via wagtail
draftjs-exporter==2.1.7
# via wagtail
Expand All @@ -116,11 +115,11 @@ filetype==1.2.0
# via willow
google-api-core==2.19.1
# via opencensus
google-auth==2.32.0
google-auth==2.33.0
# via google-api-core
googleapis-common-protos==1.63.2
# via google-api-core
gunicorn==22.0.0
gunicorn==23.0.0
# via -r requirements.in
html5lib==1.1
# via wagtail
Expand Down Expand Up @@ -153,7 +152,11 @@ packaging==24.1
# django-haystack
# gunicorn
pillow==10.4.0
# via wagtail
# via
# pillow-heif
# wagtail
pillow-heif==0.18.0
# via willow
portalocker==2.10.1
# via msal-extensions
proto-plus==1.24.0
Expand Down Expand Up @@ -185,11 +188,9 @@ pynacl==1.5.0
# via pygithub
pytz==2024.1
# via
# babel
# django
# django-modelcluster
# l18n
rcssmin==1.1.1
rcssmin==1.1.2
# via django-compressor
requests==2.32.3
# via
Expand All @@ -201,7 +202,7 @@ requests==2.32.3
# opencensus-ext-azure
# pygithub
# wagtail
rjsmin==1.2.1
rjsmin==1.2.2
# via django-compressor
rsa==4.9
# via google-auth
Expand All @@ -226,23 +227,23 @@ telepath==0.3.1
# via wagtail
typing-extensions==4.12.2
# via
# asgiref
# azure-core
# azure-identity
# azure-storage-blob
# dj-database-url
# django-modeltranslation
# pygithub
tzdata==2024.1
# via -r requirements.in
urllib3==2.2.2
# via
# elasticsearch
# pygithub
# requests
wagtail==4.1.9
wagtail==5.2.6
# via
# -r requirements.in
# wagtail-modeltranslation
wagtail-modeltranslation==0.14.4
wagtail-modeltranslation==0.15.1
# via -r requirements.in
wand==0.6.13
# via -r requirements.in
Expand All @@ -252,8 +253,10 @@ webencodings==0.5.1
# html5lib
whitenoise==6.7.0
# via -r requirements.in
willow==1.6.3
# via wagtail
willow[heif]==1.6.3
# via
# wagtail
# willow
wrapt==1.16.0
# via
# -r requirements.in
Expand Down
6 changes: 3 additions & 3 deletions requirements_dev.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ pytest-timeout
splinter
pytest-splinter
responses
flake8>3.9,<3.10
flake8
pydocstyle
pylint>2.4,<2.5
pylint-django>2.0,<2.1
pylint
pylint-django
wagtail-factories
factory-boy
sqlparse
Expand Down
Loading
Loading