From e5efe29fe62743ed419d1ccb6d05c1499ac684a0 Mon Sep 17 00:00:00 2001 From: Timo Date: Mon, 26 Apr 2021 14:03:55 +0300 Subject: [PATCH] Reworked build and nginx conf --- docker/common/nginx/nginx.conf | 7 ++++--- docker/red-ui/Dockerfile | 15 +++++++++++++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/docker/common/nginx/nginx.conf b/docker/common/nginx/nginx.conf index 731e4089e..09dd702e9 100644 --- a/docker/common/nginx/nginx.conf +++ b/docker/common/nginx/nginx.conf @@ -13,10 +13,11 @@ server { } location /ui/ { - alias /usr/share/nginx/html/redact-manager/; + alias /usr/share/nginx/html/ui/; proxy_hide_header WWW-Authenticate; - try_files $uri$args $uri$args/ $uri $uri/ /ui/index.html =404; - } + try_files $uri$args $uri$args/ $uri $uri/ /index.html =404; + } + client_max_body_size 0; gzip_min_length 1000; gzip on; diff --git a/docker/red-ui/Dockerfile b/docker/red-ui/Dockerfile index 685132e27..027dbef8c 100644 --- a/docker/red-ui/Dockerfile +++ b/docker/red-ui/Dockerfile @@ -10,7 +10,17 @@ RUN yarn install && mkdir /ng-app && mv ./node_modules ./ng-app WORKDIR /ng-app -COPY . . +COPY apps apps +COPY libs libs +COPY tools tools +COPY package.json package.json +COPY yarn.lock yarn.lock +COPY tslint.json ts.lint.json +COPY angular.json angular.json +COPY nx.json nx.json +COPY tslint.json tslint.json +COPY tsconfig.base.json tsconfig.base.json +COPY versions.sh version.sh ## Build the angular app in production mode and store the artifacts in dist folder RUN yarn lint @@ -18,6 +28,7 @@ RUN npm version patch --no-git-tag-version RUN yarn build --project=red-ui --base-href /ui/ ### STAGE 2: Setup ### + FROM nginx:1.19.2-alpine ## Copy our default nginx config @@ -27,7 +38,7 @@ COPY docker/common/nginx/nginx.conf /etc/nginx/conf.d/default.conf RUN rm -rf /usr/share/nginx/html/* ## From ‘builder’ stage copy over the artifacts in dist folder to default nginx public folder -COPY --from=builder /ng-app/dist/apps/red-ui /usr/share/nginx/html/redact-manager +COPY --from=builder /ng-app/dist/apps/red-ui /usr/share/nginx/html/ui RUN chmod o+r -R /usr/share/nginx/html RUN chmod g+r -R /usr/share/nginx/html