diff options
author | Dalf <alex@al-f.net> | 2020-02-25 17:25:11 +0100 |
---|---|---|
committer | Dalf <alex@al-f.net> | 2020-02-25 17:25:11 +0100 |
commit | 678d41d75bcdf14b17fa13f69aa323a9f8716faa (patch) | |
tree | d07dfb824dff02fa7b519dd90526a1528f6c3142 /Dockerfile | |
parent | 6a3ef5561ba48e287f0b9c03a0b6d2f13b703077 (diff) | |
download | searxng-678d41d75bcdf14b17fa13f69aa323a9f8716faa.tar.gz searxng-678d41d75bcdf14b17fa13f69aa323a9f8716faa.zip |
[enh] Docker image: uwsgi serves the static files directly.
When the image is built, the static files are compressed with gzip and brotli.
The expires header is set to one day (same as Flask)
There is not etag header (Flask does add an etag header)
Diffstat (limited to 'Dockerfile')
-rw-r--r-- | Dockerfile | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Dockerfile b/Dockerfile index 9885fb794..f61320bf7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -50,6 +50,7 @@ RUN apk upgrade --no-cache \ tini \ uwsgi \ uwsgi-python3 \ + brotli \ && pip3 install --upgrade pip \ && pip3 install --no-cache -r requirements.txt \ && apk del build-dependencies @@ -61,8 +62,10 @@ RUN su searx -c "/usr/bin/python3 -m compileall -q searx"; \ touch -c --date=@${TIMESTAMP_UWSGI} dockerfiles/uwsgi.ini; \ if [ ! -z $VERSION_GITCOMMIT ]; then\ echo "VERSION_STRING = VERSION_STRING + \"-$VERSION_GITCOMMIT\"" >> /usr/local/searx/searx/version.py; \ - fi - + fi; \ + find /usr/local/searx/searx/static -a \( -name '*.html' -o -name '*.css' -o -name '*.js' \ + -o -name '*.svg' -o -name '*.ttf' -o -name '*.eot' \) \ + -type f -exec gzip -9 -k {} \+ -exec brotli --best {} \+ # Keep this argument at the end since it change each time ARG LABEL_DATE= |