From e9a5db619bb0f4ed102f32eb987f2a50d5aedcd8 Mon Sep 17 00:00:00 2001 From: LukasJuraczka Date: Tue, 30 Dec 2025 15:01:31 +0100 Subject: [PATCH] =?UTF-8?q?build-deploy=20workflow=20hinzugef=C3=BCgt.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/build-deploy.yaml | 17 +++++++++++++++++ Dockerfile | 16 ++++++++++++++++ LICENSE | 0 angular.json | 4 ++-- docker-compose.yaml | 7 +++++++ nginx.conf | 16 ++++++++++++++++ 6 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 .gitea/workflows/build-deploy.yaml create mode 100644 Dockerfile create mode 100644 LICENSE create mode 100644 docker-compose.yaml create mode 100644 nginx.conf diff --git a/.gitea/workflows/build-deploy.yaml b/.gitea/workflows/build-deploy.yaml new file mode 100644 index 0000000..73834d9 --- /dev/null +++ b/.gitea/workflows/build-deploy.yaml @@ -0,0 +1,17 @@ +name: Angular Build & Deploy + +on: + push: + branches: [main] + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Build and Run + run: | + # Startet den Build-Prozess auf deinem Server + docker compose up -d --build diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a8df096 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +FROM node:20 AS build +WORKDIR /app + +COPY package*.json ./ +RUN npm install + +COPY . . +RUN npm run build -- --configuration=production + +FROM nginx:alpine +COPY --from=build /app/dist/OMDSAngularWebClient/browser /usr/share/nginx/html + +COPY nginx.conf /etc/nginx/conf.d/default.conf + +EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"] diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e69de29 diff --git a/angular.json b/angular.json index 6b42555..99812b5 100644 --- a/angular.json +++ b/angular.json @@ -34,8 +34,8 @@ "budgets": [ { "type": "initial", - "maximumWarning": "500kB", - "maximumError": "1MB" + "maximumWarning": "3MB", + "maximumError": "10MB" }, { "type": "anyComponentStyle", diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..cac5e8d --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,7 @@ +services: + angular-client: + build: . + container_name: omds-angular-webclient + ports: + - "9091:80" + restart: always diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..c9ae079 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,16 @@ +server { + listen 80; + server_name localhost; + + root /usr/share/nginx/html; + index index.html; + + location / { + try_files $uri $uri/ /index.html; + } + + location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ { + expires 1y; + add_header Cache-Control "public, immutable"; + } +}