diff --git a/Dockerfile b/Dockerfile index 4a975c6..d5558f5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,5 +2,6 @@ FROM nginx:latest EXPOSE 80 -COPY . /usr/share/nginx/html/ +COPY ./src/ /usr/share/nginx/html/ +COPY ./nginx.conf /etc/nginx/conf.d/default.conf diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..0e5c5a3 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,24 @@ +server { + listen 80; + server_name localhost; + + gzip on; + gzip_types text/plain application/xml; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + } + + location ~*.(js|css|ico)$ { + root /usr/share/nginx/html; + expires 2d; + add_header Cache-Control "public, no-transform"; + } + + location ~*.(ttf|png|jpg|jpeg|gif)$ { + root /usr/share/nginx/html; + expires 1y; + add_header Cache-Control "public, no-transform"; + } +}