diff --git a/Dockerfile b/Dockerfile index 39ee8e2b927..f1b08544c70 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,6 +20,8 @@ COPY ./dist/* /usr/share/nginx/html/ COPY ./docker/run.sh /usr/share/nginx/ COPY ./docker/configurator /usr/share/nginx/configurator +RUN find /usr/share/nginx/html/ -type f -regex ".*\.\(html\|js\|css\)" -exec sh -c "gzip < {} > {}.gz" \; + RUN chmod +x /usr/share/nginx/run.sh EXPOSE 8080 diff --git a/docker/nginx.conf b/docker/nginx.conf index e0bba3415b6..d66d04144eb 100644 --- a/docker/nginx.conf +++ b/docker/nginx.conf @@ -12,6 +12,13 @@ http { keepalive_timeout 65; + gzip on; + gzip_static on; + gzip_disable "msie6"; + + gzip_vary on; + gzip_types text/plain text/css application/javascript; + map $request_method $access_control_max_age { OPTIONS 1728000; # 20 days }