diff --git a/frontend/Dockerfile b/frontend/Dockerfile index f298e1e..15ab872 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -13,6 +13,7 @@ RUN ls /usr/local/app/dist FROM nginx:latest COPY --from=build /usr/local/app/dist/aktienbot /usr/share/nginx/html +COPY frontend/deploy/nginx.conf /etc/nginx HEALTHCHECK --interval=15s --timeout=2s CMD ["./deploy/healthcheck.sh"] diff --git a/frontend/deploy/nginx.conf b/frontend/deploy/nginx.conf new file mode 100644 index 0000000..d8a200f --- /dev/null +++ b/frontend/deploy/nginx.conf @@ -0,0 +1,35 @@ +events { + worker_connections 1024; ## Default: 1024 +} + +http { + ## use mime types + include /etc/nginx/mime.types; + server { + listen 80; + + location / { + root /usr/share/nginx/html; + index index.html; + ## without this our .css are not loaded + try_files $uri $uri/ /index.html?$query_string; + } + } + + ## enable gzip compression + gzip on; + gzip_vary on; + gzip_min_length 256; + gzip_proxied any; + + gzip_types + ## text/html is always compressed : https://nginx.org/en/docs/http/ngx_http_gzip_module.html + text/plain + text/css + text/javascript + application/javascript + application/x-javascript + application/xml + application/json + application/ld+json; +}