From: Radek Czajka Date: Sat, 28 Nov 2026 19:26:31 +0000 (+0100) Subject: Minor deployment X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/d3bd28055de5572326a84b36e54b72d2d7cd5cf9 Minor deployment --- diff --git a/Dockerfile b/Dockerfile index db53e2f6..6b71bf2c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,9 +5,15 @@ ARG GID=8200 RUN apt-get update \ && apt-get install -y --no-install-recommends \ - imagemagick tesseract-ocr tesseract-ocr-pol \ + imagemagick tesseract-ocr tesseract-ocr-pol curl \ && rm -rf /var/lib/apt/lists/* +# Install dart-sass for compiling SCSS. +ARG DART_SASS_VERSION=1.108.2 +RUN arch=$(dpkg --print-architecture | sed 's/amd64/x64/') && \ + curl -fsSL "https://github.com/sass/dart-sass/releases/download/${DART_SASS_VERSION}/dart-sass-${DART_SASS_VERSION}-linux-${arch}.tar.gz" \ + | tar xz -C /opt + COPY requirements/requirements.txt requirements.txt RUN --mount=type=cache,target=/root/.cache/pip \ diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 0163c6af..10d8b6bf 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -1,6 +1,7 @@ -i https://py.mdrn.pl/simple ## Python libraries +jsmin==3.0.1 merge3==0.0.13 PyYAML==6.0 Pillow==9.5.0 @@ -23,7 +24,6 @@ fnp-django-pagination==2.2.6 django-gravatar2==1.4.4 django-extensions==3.2.3 django-bootstrap4==23.1 -libsasscompiler==0.1.9 django-debug-toolbar==4.1.0 django-admin-numeric-filter==0.1.9 djangorestframework==3.14.0 @@ -33,3 +33,5 @@ django-admin-ordering==0.17 django-reversion==5.0.6 sentry-sdk==1.25.1 + +ipython diff --git a/scripts/nginx.conf b/scripts/nginx.conf index b6f605c4..780fbda9 100644 --- a/scripts/nginx.conf +++ b/scripts/nginx.conf @@ -5,6 +5,7 @@ server { error_log /dev/stderr warn; root /app/var; + client_max_body_size 200M; location /static/ { expires 30d; diff --git a/src/redakcja/settings/__init__.py b/src/redakcja/settings/__init__.py index bab79380..299637b1 100644 --- a/src/redakcja/settings/__init__.py +++ b/src/redakcja/settings/__init__.py @@ -141,11 +141,14 @@ STATICFILES_FINDERS = ( STATICFILES_STORAGE = 'pipeline.storage.PipelineManifestStorage' PIPELINE = { - 'CSS_COMPRESSOR': None, - 'JS_COMPRESSOR': None, - 'COMPILERS': ( - 'libsasscompiler.LibSassCompiler', - ), + 'JS_COMPRESSOR': 'pipeline.compressors.jsmin.JSMinCompressor', + 'COMPILERS': ('pipeline.compilers.sass.SASSCompiler',), + 'SASS_BINARY': '/opt/dart-sass/sass', + 'SASS_ARGUMENTS': '--embed-source-map --embed-sources', + # Compress CSSwith a second run of dart-sass. + 'CSS_COMPRESSOR': 'pipeline.compressors.cssmin.CSSMinCompressor', + 'CSSMIN_BINARY': '/opt/dart-sass/sass', + 'CSSMIN_ARGUMENTS': '--stdin --style=compressed --no-source-map', # CSS and JS files to compress 'STYLESHEETS': {