diff --git a/Dockerfile b/Dockerfile index 94266c0..114b02c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,4 +3,6 @@ FROM cgr.dev/chainguard/nginx:latest WORKDIR /usr/share/nginx/html COPY build . +COPY nginx.conf /etc/nginx/conf.d/default.conf + EXPOSE 8080 \ No newline at end of file diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..f3db716 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,17 @@ +server { + listen 8080; + root /usr/share/nginx/html; + gzip on; + gzip_types text/css application/javascript application/json image/svg+xml; + gzip_comp_level 9; + etag on; + location / { + try_files $uri $uri/ /index.html; + } + location /assets/ { + add_header Cache-Control max-age=31536000; + } + location /index.html { + add_header Cache-Control no-cache; + } +} \ No newline at end of file