Ajout docker et nginx

upgradeTo12
VANNEAU 3 years ago
parent ef1754e8a1
commit 747e345494
  1. 8
      .dockerignore
  2. 20
      Dockerfile
  3. 20
      nginx.conf

@ -0,0 +1,8 @@
.git
.editorconfig
/.vscode/*
/node_modules
/e2e
/docs
.gitignore
*.zip

@ -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

@ -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;
}
}
Loading…
Cancel
Save