diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000000..ca145d6abaa --- /dev/null +++ b/.dockerignore @@ -0,0 +1,8 @@ +/.git +/.github +/dev-helpers +/docs +/src +/swagger-editor-dist-package +/test +/node_modules \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 13c578b0a28..9fd6ee531bd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,6 +15,8 @@ ADD ./dist/*.css /usr/share/nginx/html/dist/ ADD ./dist/*.png /usr/share/nginx/html/dist/ ADD ./docker-run.sh /usr/share/nginx/ +RUN find /usr/share/nginx/html/ -type f -regex ".*\.\(html\|js\|css\)" -exec sh -c "gzip < {} > {}.gz" \; + EXPOSE 8080 CMD ["sh", "/usr/share/nginx/docker-run.sh"] diff --git a/nginx.conf b/nginx.conf index dda3d6de083..3e22f200a2f 100644 --- a/nginx.conf +++ b/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; + server { listen 8080; server_name localhost;