From 005a2fe26309408eea801f71700c4a75162cca3a Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 8 Aug 2019 17:05:05 +0200 Subject: [PATCH] :construction_worker: Improve gzip configuration on docker image. --- docker/frontend/Dockerfile | 2 +- docker/frontend/nginx/conf.d/default.conf | 8 +++++--- manage.sh | 7 +++++++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/docker/frontend/Dockerfile b/docker/frontend/Dockerfile index 7d14c59c1..9f4563ce8 100644 --- a/docker/frontend/Dockerfile +++ b/docker/frontend/Dockerfile @@ -1,4 +1,4 @@ -FROM nginx:alpine +FROM nginx:1.17.2 LABEL maintainer="Monogramm Maintainers " diff --git a/docker/frontend/nginx/conf.d/default.conf b/docker/frontend/nginx/conf.d/default.conf index 9032f7c82..98d36af08 100644 --- a/docker/frontend/nginx/conf.d/default.conf +++ b/docker/frontend/nginx/conf.d/default.conf @@ -4,14 +4,16 @@ server { server_name _; + gzip on; + gzip_static on; + gzip_proxied any; + gzip_types text/plain text/html text/css text/javascript application/javascript application/json application/transit+json; + # Frontend location / { root /usr/share/nginx/html/; try_files $uri /index.html; - gzip on; - gzip_types text/css text/javascript application/x-javascript application/javascript application/json; - add_header Cache-Control "max-age=15552000" always; } diff --git a/manage.sh b/manage.sh index 23d80a0d5..0a5514c38 100755 --- a/manage.sh +++ b/manage.sh @@ -182,6 +182,10 @@ function run { docker-compose -p uxbox -f ./docker/docker-compose.yml up -d } +function log { + docker-compose -p uxbox -f docker/docker-compose.yml logs -f --tail=50 +} + function stop { echo "Stoping containers..." docker-compose -p uxbox -f ./docker/docker-compose.yml stop @@ -242,6 +246,9 @@ case $1 in run) run ;; + log) + log + ;; stop) stop ;;