Skip to content

Commit

Permalink
quick update
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuldeep-knoldus committed Jun 27, 2024
1 parent c54607c commit 34cb429
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 65 deletions.
14 changes: 4 additions & 10 deletions .github/workflows/gcp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -125,7 +119,7 @@ jobs:
kubectl apply -f .
cd ../..
fi
done
sonarcloud:
name: SonarCloud Analysis
Expand Down
44 changes: 0 additions & 44 deletions .gitignore

This file was deleted.

32 changes: 28 additions & 4 deletions blogs-analyzer-ui/Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand Down
6 changes: 4 additions & 2 deletions blogs-analyzer-ui/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -25,6 +26,7 @@
],
"tsConfig": "tsconfig.app.json",
"inlineStyleLanguage": "scss",
"aot": true,
"assets": [
"src/favicon.ico",
"src/assets"
Expand All @@ -41,8 +43,8 @@
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
"maximumWarning": "5000kb",
"maximumError": "10mb"
},
{
"type": "anyComponentStyle",
Expand Down
5 changes: 0 additions & 5 deletions package.json

This file was deleted.

0 comments on commit 34cb429

Please sign in to comment.