ソースを参照

improvement(docker): gzip static files (via #5199)

bubble
Yann Odeyer 5年前
committed by kyle
コミット
dd961ed401
2個のファイルの変更9行の追加0行の削除
  1. +2
    -0
      Dockerfile
  2. +7
    -0
      docker/nginx.conf

+ 2
- 0
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


+ 7
- 0
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
}


読み込み中…
キャンセル
保存