Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix ci/cd build docker image #39

Merged
merged 4 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ jobs:

- 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 }}

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 .
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,17 @@ 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:

```yml
version: '3.8'
services:
apiservice:
image: blazordevlab/cleanaspire-api:0.0.62
image: blazordevlab/cleanaspire-api:0.0.64
environment:
- ASPNETCORE_ENVIRONMENT=Development
- AllowedHosts=*
Expand All @@ -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=*
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/CleanAspire.Api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 "./CleanAspire.Api.csproj" -c Release -o /app/publish

# Stage 2: Create the runtime image
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime
Expand Down
2 changes: 1 addition & 1 deletion src/CleanAspire.ClientApp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/CleanAspire.ClientApp/wwwroot/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"ClientAppSettings": {
"AppName": "Blazor Aspire",
"Version": "v0.0.62",
"Version": "v0.0.64",
"ServiceBaseUrl": "https://apiservice.blazorserver.com"
}
}
2 changes: 1 addition & 1 deletion src/CleanAspire.WebApp/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"AllowedHosts": "*",
"ClientAppSettings": {
"AppName": "Blazor Aspire",
"Version": "v0.0.62",
"Version": "v0.0.64",
"ServiceBaseUrl": "https://apiservice.blazorserver.com"
}
}
Loading