From 1f66daca4c4db48303e1a65290e16821a4ab1da3 Mon Sep 17 00:00:00 2001 From: hualin Date: Wed, 8 Jan 2025 16:08:53 +0800 Subject: [PATCH 1/4] commit --- .github/workflows/docker.yml | 4 ---- .github/workflows/docker2.yml | 38 +++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/docker2.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index fb60f14..b66b998 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -31,10 +31,6 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: Build and push CleanAspire.Standalone image - run: | - docker build -t ${{ secrets.DOCKER_USERNAME }}/cleanaspire-standalone:${{ steps.version.outputs.version }} -f src/CleanAspire.ClientApp/Dockerfile . - docker push ${{ secrets.DOCKER_USERNAME }}/cleanaspire-standalone:${{ steps.version.outputs.version }} - name: Build and push CleanAspire.WebApp image run: | diff --git a/.github/workflows/docker2.yml b/.github/workflows/docker2.yml new file mode 100644 index 0000000..53fde99 --- /dev/null +++ b/.github/workflows/docker2.yml @@ -0,0 +1,38 @@ +name: Build and Push Docker Standalone Image + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Get next version + uses: reecetech/version-increment@2024.10.1 + id: version + with: + scheme: semver + increment: patch + + - run: git tag ${{ steps.version.outputs.version }} + - run: git push origin ${{ steps.version.outputs.version }} + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push CleanAspire.Standalone image + run: | + docker build -t ${{ secrets.DOCKER_USERNAME }}/cleanaspire-standalone:${{ steps.version.outputs.version }} -f src/CleanAspire.ClientApp/Dockerfile . + docker push ${{ secrets.DOCKER_USERNAME }}/cleanaspire-standalone:${{ steps.version.outputs.version }} + \ No newline at end of file From d93283e830f27512f9f7702d8d1bfade4284aaa8 Mon Sep 17 00:00:00 2001 From: hualin Date: Wed, 8 Jan 2025 16:20:38 +0800 Subject: [PATCH 2/4] commit --- .github/workflows/docker.yml | 5 +++- .github/workflows/docker2.yml | 38 ---------------------------- src/CleanAspire.Api/Dockerfile | 2 +- src/CleanAspire.ClientApp/Dockerfile | 2 +- 4 files changed, 6 insertions(+), 41 deletions(-) delete mode 100644 .github/workflows/docker2.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index b66b998..ebca3ea 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -31,7 +31,10 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - + - name: Build and push CleanAspire.Standalone image + run: | + docker build -t ${{ secrets.DOCKER_USERNAME }}/cleanaspire-standalone:${{ steps.version.outputs.version }} -f src/CleanAspire.ClientApp/Dockerfile . + docker push ${{ secrets.DOCKER_USERNAME }}/cleanaspire-standalone:${{ steps.version.outputs.version }} - name: Build and push CleanAspire.WebApp image run: | docker build -t ${{ secrets.DOCKER_USERNAME }}/cleanaspire-webapp:${{ steps.version.outputs.version }} -f src/CleanAspire.WebApp/Dockerfile . diff --git a/.github/workflows/docker2.yml b/.github/workflows/docker2.yml deleted file mode 100644 index 53fde99..0000000 --- a/.github/workflows/docker2.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Build and Push Docker Standalone Image - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Get next version - uses: reecetech/version-increment@2024.10.1 - id: version - with: - scheme: semver - increment: patch - - - run: git tag ${{ steps.version.outputs.version }} - - run: git push origin ${{ steps.version.outputs.version }} - - - name: Log in to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Build and push CleanAspire.Standalone image - run: | - docker build -t ${{ secrets.DOCKER_USERNAME }}/cleanaspire-standalone:${{ steps.version.outputs.version }} -f src/CleanAspire.ClientApp/Dockerfile . - docker push ${{ secrets.DOCKER_USERNAME }}/cleanaspire-standalone:${{ steps.version.outputs.version }} - \ No newline at end of file diff --git a/src/CleanAspire.Api/Dockerfile b/src/CleanAspire.Api/Dockerfile index 11a92c8..1e28944 100644 --- a/src/CleanAspire.Api/Dockerfile +++ b/src/CleanAspire.Api/Dockerfile @@ -15,7 +15,7 @@ RUN dotnet restore "src/CleanAspire.Api/CleanAspire.Api.csproj" COPY . . WORKDIR /src/src/CleanAspire.Api -RUN dotnet publish -c Release -o /app/publish +RUN dotnet publish "src/CleanAspire.Api/CleanAspire.Api.csproj" -c Release -o /app/publish # Stage 2: Create the runtime image FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime diff --git a/src/CleanAspire.ClientApp/Dockerfile b/src/CleanAspire.ClientApp/Dockerfile index 5500042..43e4bd2 100644 --- a/src/CleanAspire.ClientApp/Dockerfile +++ b/src/CleanAspire.ClientApp/Dockerfile @@ -15,7 +15,7 @@ RUN dotnet workload update # Copy the entire source code and build the application in Release mode COPY . . -RUN dotnet publish -c Release -o /app/publish -p:DefineConstants=STANDALONE +RUN dotnet publish "src/CleanAspire.ClientApp/CleanAspire.ClientApp.csproj" -c Release -o /app/publish -p:DefineConstants=STANDALONE # Stage 2: Serve the Blazor Client Application using Nginx FROM nginx:alpine AS final From bd0eceae5cce510b5ff521b08dcba1c8d6f3f264 Mon Sep 17 00:00:00 2001 From: hualin Date: Wed, 8 Jan 2025 16:25:26 +0800 Subject: [PATCH 3/4] Update Dockerfile --- src/CleanAspire.Api/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CleanAspire.Api/Dockerfile b/src/CleanAspire.Api/Dockerfile index 1e28944..d0adc9d 100644 --- a/src/CleanAspire.Api/Dockerfile +++ b/src/CleanAspire.Api/Dockerfile @@ -15,7 +15,7 @@ RUN dotnet restore "src/CleanAspire.Api/CleanAspire.Api.csproj" COPY . . WORKDIR /src/src/CleanAspire.Api -RUN dotnet publish "src/CleanAspire.Api/CleanAspire.Api.csproj" -c Release -o /app/publish +RUN dotnet publish "./CleanAspire.Api.csproj" -c Release -o /app/publish # Stage 2: Create the runtime image FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime From 8e4804cf72cd25cfc65c204e3fd782f4da1699df Mon Sep 17 00:00:00 2001 From: hualin Date: Wed, 8 Jan 2025 16:32:58 +0800 Subject: [PATCH 4/4] done --- README.md | 9 ++++++--- src/CleanAspire.ClientApp/wwwroot/appsettings.json | 2 +- src/CleanAspire.WebApp/appsettings.json | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 13a5353..e4d009d 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,9 @@ https://github.com/neozhu/cleanaspire/issues/34 ### OpenAPI documentation - https://apiservice.blazorserver.com/scalar/v1 +### Blazor WebAssembly Standalone PWA +- https://standalone.blazorserver.com/ + ### Here is an example of a docker-compose.yml file for a local Docker deployment: @@ -89,7 +92,7 @@ https://github.com/neozhu/cleanaspire/issues/34 version: '3.8' services: apiservice: - image: blazordevlab/cleanaspire-api:0.0.62 + image: blazordevlab/cleanaspire-api:0.0.64 environment: - ASPNETCORE_ENVIRONMENT=Development - AllowedHosts=* @@ -111,7 +114,7 @@ services: - "8018:443" blazorweb: - image: blazordevlab/cleanaspire-webapp:0.0.62 + image: blazordevlab/cleanaspire-webapp:0.0.64 environment: - ASPNETCORE_ENVIRONMENT=Production - AllowedHosts=* @@ -123,7 +126,7 @@ services: - "8014:443" standalone: - image: blazordevlab/cleanaspire-standalone:0.0.62 + image: blazordevlab/cleanaspire-standalone:0.0.64 ports: - "8020:80" - "8021:443" diff --git a/src/CleanAspire.ClientApp/wwwroot/appsettings.json b/src/CleanAspire.ClientApp/wwwroot/appsettings.json index e83e9a6..c3f998d 100644 --- a/src/CleanAspire.ClientApp/wwwroot/appsettings.json +++ b/src/CleanAspire.ClientApp/wwwroot/appsettings.json @@ -7,7 +7,7 @@ }, "ClientAppSettings": { "AppName": "Blazor Aspire", - "Version": "v0.0.62", + "Version": "v0.0.64", "ServiceBaseUrl": "https://apiservice.blazorserver.com" } } diff --git a/src/CleanAspire.WebApp/appsettings.json b/src/CleanAspire.WebApp/appsettings.json index 05f0e46..e6e9c4c 100644 --- a/src/CleanAspire.WebApp/appsettings.json +++ b/src/CleanAspire.WebApp/appsettings.json @@ -8,7 +8,7 @@ "AllowedHosts": "*", "ClientAppSettings": { "AppName": "Blazor Aspire", - "Version": "v0.0.62", + "Version": "v0.0.64", "ServiceBaseUrl": "https://apiservice.blazorserver.com" } }