diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000000000000000000000000000000000..f56ff1c859f05ebdad9da423c9d7e4040e98476e --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +/node_modules +.idea +.prettierrc.json +yarn-error.log diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..ebc5caf7d8ee4cb38d7261863416a14e60dbeade --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM node:18-alpine as build-stage + +WORKDIR /app +COPY package*.json /app/ +RUN npm install +COPY ./ /app/ +ARG configuration=production +RUN npm run build -- --output-path=./dist/out --configuration $configuration + +FROM nginx:1.15 +COPY --from=build-stage /app/dist/out/ /usr/share/nginx/html +COPY ./nginx-custom.conf /etc/nginx/conf.d/default.conf diff --git a/nginx-custom.conf b/nginx-custom.conf new file mode 100644 index 0000000000000000000000000000000000000000..2c11f9b7756dccad5dd84f308f882ec4c38f17f6 --- /dev/null +++ b/nginx-custom.conf @@ -0,0 +1,20 @@ +# Expires map +map $sent_http_content_type $expires { + default off; + text/html epoch; + text/css max; + application/json max; + application/javascript max; + ~image/ max; +} + +server { + listen 80; + location / { + root /usr/share/nginx/html; + index index.html index.htm; + try_files $uri $uri/ /index.html =404; + } + expires $expires; + gzip on; +} \ No newline at end of file