From 34cb42914361e2307eab0972e91618cc22a646e5 Mon Sep 17 00:00:00 2001 From: kuldeep Date: Thu, 27 Jun 2024 21:14:22 +0530 Subject: [PATCH] quick update --- .github/workflows/gcp.yml | 14 ++++------- .gitignore | 44 ---------------------------------- blogs-analyzer-ui/Dockerfile | 32 +++++++++++++++++++++---- blogs-analyzer-ui/angular.json | 6 +++-- package.json | 5 ---- 5 files changed, 36 insertions(+), 65 deletions(-) delete mode 100644 .gitignore delete mode 100644 package.json diff --git a/.github/workflows/gcp.yml b/.github/workflows/gcp.yml index e120e34..6346f96 100644 --- a/.github/workflows/gcp.yml +++ b/.github/workflows/gcp.yml @@ -100,15 +100,9 @@ jobs: echo "Building and pushing Docker image for $SERVICE_NAME" if [ -d "$SERVICE_NAME" ]; then cd $SERVICE_NAME - if [ "$SERVICE_NAME" != "blogs-analyzer-ui" ]; then - IMAGE_NAME=gcr.io/${{ secrets.PROJECT_ID }}/$SERVICE_NAME:latest - docker build -t $IMAGE_NAME . - docker push $IMAGE_NAME - else - IMAGE_NAME=gcr.io/${{ secrets.PROJECT_ID }}/blogs-analyzer-ui:latest - docker build -t $IMAGE_NAME . - docker push $IMAGE_NAME - fi + IMAGE_NAME=gcr.io/${{ secrets.PROJECT_ID }}/$SERVICE_NAME:latest + docker build -t $IMAGE_NAME . + docker push $IMAGE_NAME cd .. fi done @@ -125,7 +119,7 @@ jobs: kubectl apply -f . cd ../.. fi - + done sonarcloud: name: SonarCloud Analysis diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 1f4031f..0000000 --- a/.gitignore +++ /dev/null @@ -1,44 +0,0 @@ -# See http://help.github.com/ignore-files/ for more about ignoring files. - -# Compiled output -/dist -/tmp -/out-tsc -/bazel-out - -# Node -/node_modules -npm-debug.log -yarn-error.log - -# IDEs and editors -.idea/ -.project -.classpath -.c9/ -*.launch -.settings/ -*.sublime-workspace - -# Visual Studio Code -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json -.history/* - -# Miscellaneous -/.angular/cache -.sass-cache/ -/connect.lock -/coverage -/libpeerconnection.log -testem.log -/typings - -# System files -.DS_Store -Thumbs.db - -package-lock.json diff --git a/blogs-analyzer-ui/Dockerfile b/blogs-analyzer-ui/Dockerfile index 617a28d..d4c6a12 100644 --- a/blogs-analyzer-ui/Dockerfile +++ b/blogs-analyzer-ui/Dockerfile @@ -1,12 +1,36 @@ +# Stage 1: Build the Angular application +FROM node:21 AS build + +# Set the working directory in the container +WORKDIR /app + +# Copy package.json and package-lock.json to the working directory +COPY package*.json ./ + +# Install Angular CLI globally +RUN npm install -g @angular/cli + +# Install dependencies +RUN npm install + +# Copy the rest of the application code to the working directory +COPY . . + +# Build the Angular app in production mode +RUN ng build + # Stage 2: Use a smaller, nginx-based image to serve the app -FROM nginx:alpine +FROM nginx:1.21-alpine + +# Copy custom nginx configuration +COPY nginx.conf /etc/nginx/nginx.conf + +# Create log directory configured in nginx.conf +RUN mkdir -p /var/log/app_engine # Copy the built app from the previous stage to the nginx web server directory COPY --from=build /app/dist/blogs-analyzer-ui /usr/share/nginx/html -# Copy custom nginx configuration -COPY nginx-custom.conf /etc/nginx/conf.d/default.conf - # Expose port 80 to the Docker environment EXPOSE 80 diff --git a/blogs-analyzer-ui/angular.json b/blogs-analyzer-ui/angular.json index 7cece2a..5279992 100644 --- a/blogs-analyzer-ui/angular.json +++ b/blogs-analyzer-ui/angular.json @@ -17,6 +17,7 @@ "build": { "builder": "@angular-devkit/build-angular:browser", "options": { + "allowedCommonJsDependencies": ["highcharts"], "outputPath": "dist/blogs-analyzer-ui", "index": "src/index.html", "main": "src/main.ts", @@ -25,6 +26,7 @@ ], "tsConfig": "tsconfig.app.json", "inlineStyleLanguage": "scss", + "aot": true, "assets": [ "src/favicon.ico", "src/assets" @@ -41,8 +43,8 @@ "budgets": [ { "type": "initial", - "maximumWarning": "500kb", - "maximumError": "1mb" + "maximumWarning": "5000kb", + "maximumError": "10mb" }, { "type": "anyComponentStyle", diff --git a/package.json b/package.json deleted file mode 100644 index 37ff0d6..0000000 --- a/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "dependencies": { - "html-to-pdfmake": "^2.5.10" - } -}