diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..de965fa --- /dev/null +++ b/.dockerignore @@ -0,0 +1,8 @@ +.git +.editorconfig +/.vscode/* +/node_modules +/e2e +/docs +.gitignore +*.zip \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4c4341c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +## STEP 1 BUILD ## +FROM node:17.0.1-alpine AS build + +WORKDIR /dist/src/app + +RUN npm cache clean --force + +COPY . . + +RUN npm install + +RUN npm run build --prod + +## STEP 2 DEPLOY ## +FROM nginx:1.21.3 AS ngi + +COPY --from=build /dist/src/app/dist/EPAClient /usr/share/nginx/html +COPY /nginx.conf /etc/nginx/conf.d/default.conf + +EXPOSE 80 \ No newline at end of file diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..6d88c24 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,20 @@ +server { + listen 80; + sendfile on; + default_type application/octet-stream; + + gzip on; + gzip_http_version 1.1; + gzip_disable "MSIE [1-6]\."; + gzip_min_length 256; + gzip_vary on; + gzip_proxied expired no-cache no-store private auth; + gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript; + gzip_comp_level 9; + + root /usr/share/nginx/html; + + location / { + try_files $uri $uri/ /index.html =404; + } +} \ No newline at end of file