From 44c77a8aadb0be115bf465595b27ece74ac63bf2 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 12 Aug 2021 18:38:05 +0200 Subject: [PATCH] Added docker basics --- Dockerfile | 11 +++++++++++ docker-compose.yml | 6 ++++++ nginx.conf | 49 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml create mode 100644 nginx.conf diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8d3ec8f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM registry.odit.services/hub/library/node:16-alpine3.13 +WORKDIR /app +COPY package.json *.config.cjs *.config.js ./ +RUN yarn +COPY src ./src +COPY static ./static +RUN yarn build +# final image +FROM registry.odit.services/hub/fholzer/nginx-brotli:v1.19.1 +COPY --from=0 /app/build /usr/share/nginx/html +COPY ./nginx.conf /etc/nginx/nginx.conf \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..93eaca7 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,6 @@ +version: '3' +services: + http: + build: . + ports: + - 4269:80 diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..6cbfa62 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,49 @@ +events { +} +http { + include mime.types; + sendfile on; + server { + error_page 404 /index.html; + root /usr/share/nginx/html; + location ~ /index\.html$ { + internal; + add_header Cache-Control 'no-store'; + } + location ~* \.(png|jpg|jpeg|webp|gif|ico|woff|otf|ttf|eot|svg|txt|pdf|docx?|xlsx?)$ { + access_log off; + expires 1y; + } + location / { + try_files $uri $uri/ /index.html; + } + # --- GZIP + gzip on; + gzip_disable "msie6"; + gzip_vary on; + gzip_proxied any; + gzip_comp_level 6; + gzip_buffers 16 8k; + gzip_http_version 1.1; + gzip_types application/javascript + application/rss+xml + application/vnd.ms-fontobject + application/x-font + application/x-font-opentype + application/x-font-otf + application/x-font-truetype + application/x-font-ttf + application/x-javascript + application/xhtml+xml + application/xml + font/opentype + font/otf + font/ttf + image/svg+xml + image/x-icon + text/css + text/javascript + text/plain + text/xml; + } +} \ No newline at end of file