Skip to content

Commit

Permalink
perf: enable gzip
Browse files Browse the repository at this point in the history
  • Loading branch information
davidyuk committed May 24, 2023
1 parent 75b0d2c commit 5f182d3
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
!.postcssrc.js
!babel.config.js
!vue.config.js
!docker/nginx
!docker/nginx.conf
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,5 @@ ARG VUE_APP_BACKEND_URL
RUN NODE_OPTIONS=--openssl-legacy-provider npm run build

FROM nginx:1.24-alpine
COPY docker/nginx/nginx.conf /etc/nginx/nginx.conf
COPY docker/nginx/default.conf /etc/nginx/conf.d/default.conf
COPY docker/nginx.conf /etc/nginx/nginx.conf
COPY --from=aepp-aepp-base-build /app/dist /usr/share/nginx/html
35 changes: 35 additions & 0 deletions docker/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
user nginx;
worker_processes 1;

error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;

events {
worker_connections 1024;
}

http {
include /etc/nginx/mime.types;
types {
application/json map;
}
default_type application/octet-stream;

sendfile on;
keepalive_timeout 60;
gzip on;
gzip_types application/javascript text/css image/svg+xml;

server {
root /usr/share/nginx/html;

location ~ /(css|img|js) {
expires max;
etag off;
}

location / {
try_files $uri $uri/ /index.html;
}
}
}
6 changes: 0 additions & 6 deletions docker/nginx/default.conf

This file was deleted.

19 changes: 0 additions & 19 deletions docker/nginx/nginx.conf

This file was deleted.

0 comments on commit 5f182d3

Please sign in to comment.