Compare commits

..

23 Commits

Author SHA1 Message Date
masoud
3c528aba48 fix: Revert to aspnet runtime - FrontOffice is Blazor Server not WASM
All checks were successful
Build and Deploy / build (push) Successful in 1m42s
- Project uses Microsoft.NET.Sdk.Web (Blazor Server)
- Not Microsoft.NET.Sdk.BlazorWebAssembly
- Needs aspnet runtime to run the .dll, not nginx for static files
- Changed back from nginx:alpine to aspnet:9.0
2025-12-07 23:35:09 +00:00
masoud
380b4788dd fix: Remove default nginx files before copying Blazor WASM output
All checks were successful
Build and Deploy / build (push) Successful in 1m51s
- nginx:alpine has default index.html that prevents Blazor from loading
- Added RUN rm -rf /usr/share/nginx/html/* before COPY
2025-12-07 23:30:17 +00:00
masoud
0395c74041 fix: Change FrontOffice Dockerfile to nginx runtime for Blazor WASM
All checks were successful
Build and Deploy / build (push) Successful in 1m44s
- Changed from aspnet to nginx:alpine
- Copy wwwroot output instead of FrontOffice.dll
- Configure nginx SPA routing (try_files for client-side routing)
- Remove ENTRYPOINT dotnet command
- Fix project name references (FrontOffice.Main.csproj)
2025-12-07 22:48:28 +00:00
masoud
0f20d216b6 remove: Delete incorrect Dockerfile from root
Some checks failed
Build and Deploy / build (push) Failing after 16s
Workflow uses src/FrontOffice.Main/Dockerfile which is correct (nginx).
Root Dockerfile was using wrong runtime (aspnet instead of nginx).
2025-12-07 22:44:46 +00:00
baf984a942 Update src/FrontOffice.Main/Dockerfile
Some checks failed
Build and Deploy / build (push) Failing after 14s
2025-12-07 22:34:16 +00:00
2b07cc2270 Update src/FrontOffice.Main/Dockerfile
Some checks failed
Build and Deploy / build (push) Failing after 14s
2025-12-07 22:29:24 +00:00
masoodafar-web
b51a4b51cc refactor: migrate from nginx to aspnet runtime
Some checks failed
Build and Deploy / build (push) Failing after 13s
2025-12-08 01:55:13 +03:30
masoud
410f31671d fix: update kubeconfig for deployment
All checks were successful
Build and Deploy / build (push) Successful in 4m39s
2025-12-07 19:10:58 +00:00
masoud
1f9580cd6e test: trigger workflow to debug failure
All checks were successful
Build and Deploy / build (push) Successful in 1m40s
2025-12-07 19:09:00 +00:00
masoud
39c1c979db chore: test multi-remote push to git.afrino.co
Some checks failed
Build and Deploy / build (push) Failing after 1m30s
2025-12-07 18:52:37 +00:00
masoud
8eac688ad9 chore: trigger rebuild with new registry domain
All checks were successful
Build and Deploy / build (push) Successful in 1m27s
2025-12-07 17:32:24 +00:00
masoud
07be693b92 chore: migrate from IP to domain (git.foursat.afrino.co)
Some checks failed
Build and Deploy / build (push) Has been cancelled
2025-12-07 17:01:57 +00:00
masoud
65a64bf63b Update GwUrl to HTTPS domain with Let's Encrypt
Some checks failed
Build and Deploy / build (push) Has been cancelled
2025-12-07 15:05:21 +00:00
masoud
1d8aec3b7e Update GwUrl to external NodePort endpoint 2025-12-07 14:49:56 +00:00
masoud
08595e4f95 Revert: Back to nginx for Blazor WASM 2025-12-06 23:11:07 +00:00
masoud
abcc079fdd Fix: Revert to aspnet runtime for Blazor Server with gRPC 2025-12-06 23:08:54 +00:00
masoodafar-web
2a2efd0376 feat: Add proxy configuration for Docker daemon and build process 2025-12-07 01:15:25 +03:30
masoud
e3841f07cc Fix: Correct Dockerfile path to FrontOffice.Main/Dockerfile 2025-12-06 21:42:24 +00:00
masoud
de5c33196b Fix: Use nginx for Blazor WASM instead of aspnet runtime 2025-12-06 21:24:28 +00:00
masoodafar-web
559fbbf6cd feat: Update Kubernetes deployment with proxy and registry config 2025-12-07 00:49:01 +03:30
masoodafar-web
8a7f68a167 Merge branch 'main' into kub-stage
# Conflicts:
#	.gitea/workflows/kub-deploy.yml
2025-12-07 00:25:09 +03:30
masoodafar-web
ebae8f3e16 Add Docker deployment configuration and update package references 2025-12-07 00:05:55 +03:30
masoud
fba5cdbabe Add Kubernetes CI/CD pipeline for kub-stage 2025-12-05 16:25:14 +00:00
7 changed files with 190 additions and 17 deletions

View File

@@ -0,0 +1,90 @@
name: Build and Deploy
on:
push:
branches:
- kub-stage
env:
REGISTRY: gitea-svc:3000
IMAGE_NAME: admin/frontoffice
jobs:
build:
runs-on: ubuntu-latest
container:
image: docker:latest
options: --privileged
env:
HTTP_PROXY: http://proxyuser:87zH26nbqT2@46.249.98.211:3128
HTTPS_PROXY: http://proxyuser:87zH26nbqT2@46.249.98.211:3128
NO_PROXY: localhost,127.0.0.1,gitea-svc,194.5.195.53,10.0.0.0/8
steps:
- name: Install dependencies
run: |
apk add --no-cache git curl
# Install kubectl
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
mv kubectl /usr/local/bin/
- name: Start Docker daemon with insecure registry
run: |
mkdir -p /etc/docker
cat > /etc/docker/daemon.json << 'DAEMON'
{
"insecure-registries": ["git.foursat.afrino.co", "gitea-svc:3000"]
}
DAEMON
mkdir -p ~/.docker
cat > ~/.docker/config.json << 'CONF'
{
"proxies": {
"default": {
"httpProxy": "http://proxyuser:87zH26nbqT2@46.249.98.211:3128",
"httpsProxy": "http://proxyuser:87zH26nbqT2@46.249.98.211:3128",
"noProxy": "localhost,127.0.0.1,gitea-svc,194.5.195.53,10.0.0.0/8"
}
}
}
CONF
dockerd &
for i in $(seq 1 30); do
docker info >/dev/null 2>&1 && break || sleep 2
done
docker info
- name: Checkout code
run: |
git clone --depth 1 --branch kub-stage http://gitea-svc:3000/admin/FrontOffice.git .
git log -1 --format="%H %s"
- name: Build Docker Image
run: |
cd src
docker build -f FrontOffice.Main/Dockerfile \
-t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} \
-t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest \
--build-arg HTTP_PROXY=http://proxyuser:87zH26nbqT2@46.249.98.211:3128 \
--build-arg HTTPS_PROXY=http://proxyuser:87zH26nbqT2@46.249.98.211:3128 \
.
- name: Push to Registry
run: |
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login ${{ env.REGISTRY }} -u admin --password-stdin
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
- name: Deploy to Kubernetes
run: |
# Setup kubeconfig
mkdir -p ~/.kube
echo "${{ secrets.KUBECONFIG }}" | base64 -d > ~/.kube/config
# Restart deployment to pull new image
kubectl rollout restart deployment/frontoffice || echo "Deployment doesn't exist yet"
# Wait for rollout to complete
kubectl rollout status deployment/frontoffice --timeout=5m || echo "Deployment rollout pending"

1
README.md Normal file
View File

@@ -0,0 +1 @@
# Test multi-remote push Sun Dec 7 19:09:00 UTC 2025

25
src/.dockerignore Normal file
View File

@@ -0,0 +1,25 @@
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/.idea
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md

View File

@@ -0,0 +1,26 @@
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /src
# Copy NuGet config and project file
COPY ["FrontOffice.Main/NuGet.config", "NuGet.config"]
COPY ["FrontOffice.Main/FrontOffice.Main.csproj", "FrontOffice.Main/"]
# Restore dependencies
RUN dotnet restore "FrontOffice.Main/FrontOffice.Main.csproj" --configfile NuGet.config
# Copy all source code
COPY . .
# Build and publish
WORKDIR "/src/FrontOffice.Main"
RUN dotnet publish "FrontOffice.Main.csproj" -c Release -o /app/publish
# Runtime stage - aspnet for Blazor Server
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime
WORKDIR /app
COPY --from=build /app/publish .
ENV ASPNETCORE_URLS=http://+:80
EXPOSE 80
ENTRYPOINT ["dotnet", "FrontOffice.Main.dll"]

View File

@@ -5,18 +5,24 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>6dab807c-c6d8-4711-bf64-11c69e8d39f4</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DateTimeConverterCL" Version="1.0.0" />
<PackageReference Include="Foursat.FrontOffice.BFF.Package.Protobuf" Version="0.0.112" />
<PackageReference Include="Foursat.FrontOffice.BFF.Products.Protobuf" Version="0.0.15" />
<PackageReference Include="Foursat.FrontOffice.BFF.Transaction.Protobuf" Version="0.0.111" />
<PackageReference Include="Foursat.FrontOffice.BFF.Category.Protobuf" Version="0.0.12" />
<PackageReference Include="Foursat.FrontOffice.BFF.User.Protobuf" Version="0.0.116" />
<PackageReference Include="Foursat.FrontOffice.BFF.UserAddress.Protobuf" Version="0.0.114" />
<PackageReference Include="Foursat.FrontOffice.BFF.UserOrder.Protobuf" Version="0.0.114" />
<PackageReference Include="Foursat.FrontOffice.BFF.ShopingCart.Protobuf" Version="0.0.15" />
<PackageReference Include="Foursat.FrontOffice.BFF.ClubMembership.Protobuf" Version="0.0.3" />
<PackageReference Include="Foursat.FrontOffice.BFF.Commission.Protobuf" Version="0.0.2" />
<PackageReference Include="Foursat.FrontOffice.BFF.DiscountShop.Protobuf" Version="0.0.2" />
<PackageReference Include="Foursat.FrontOffice.BFF.NetworkMembership.Protobuf" Version="0.0.2" />
<PackageReference Include="Foursat.FrontOffice.BFF.Package.Protobuf" Version="0.0.113" />
<PackageReference Include="Foursat.FrontOffice.BFF.Products.Protobuf" Version="0.0.17" />
<PackageReference Include="Foursat.FrontOffice.BFF.Transaction.Protobuf" Version="0.0.112" />
<PackageReference Include="Foursat.FrontOffice.BFF.Category.Protobuf" Version="0.0.13" />
<PackageReference Include="Foursat.FrontOffice.BFF.User.Protobuf" Version="0.0.117" />
<PackageReference Include="Foursat.FrontOffice.BFF.UserAddress.Protobuf" Version="0.0.115" />
<PackageReference Include="Foursat.FrontOffice.BFF.UserOrder.Protobuf" Version="0.0.115" />
<PackageReference Include="Foursat.FrontOffice.BFF.ShopingCart.Protobuf" Version="0.0.16" />
<PackageReference Include="Foursat.FrontOffice.BFF.UserWallet.Protobuf" Version="0.0.15" />
<!-- UserWallet moved to ProjectReference for latest proto -->
<PackageReference Include="MudBlazor" Version="8.14.0" />
<PackageReference Include="Blazored.LocalStorage" Version="4.5.0" />
@@ -29,17 +35,24 @@
</ItemGroup>
<!-- New Proto Projects (local references until NuGet publish) -->
<ItemGroup>
<ProjectReference Include="..\..\..\FrontOffice.BFF\src\Protobufs\FrontOffice.BFF.ClubMembership.Protobuf\FrontOffice.BFF.ClubMembership.Protobuf.csproj" />
<ProjectReference Include="..\..\..\FrontOffice.BFF\src\Protobufs\FrontOffice.BFF.Commission.Protobuf\FrontOffice.BFF.Commission.Protobuf.csproj" />
<ProjectReference Include="..\..\..\FrontOffice.BFF\src\Protobufs\FrontOffice.BFF.NetworkMembership.Protobuf\FrontOffice.BFF.NetworkMembership.Protobuf.csproj" />
<ProjectReference Include="..\..\..\FrontOffice.BFF\src\Protobufs\FrontOffice.BFF.DiscountShop.Protobuf\FrontOffice.BFF.DiscountShop.Protobuf.csproj" />
<ProjectReference Include="..\..\..\FrontOffice.BFF\src\Protobufs\FrontOffice.BFF.UserWallet.Protobuf\FrontOffice.BFF.UserWallet.Protobuf.csproj" />
</ItemGroup>
<!-- <ItemGroup>-->
<!-- <ProjectReference Include="..\..\..\FrontOffice.BFF\src\Protobufs\FrontOffice.BFF.ClubMembership.Protobuf\FrontOffice.BFF.ClubMembership.Protobuf.csproj" />-->
<!-- <ProjectReference Include="..\..\..\FrontOffice.BFF\src\Protobufs\FrontOffice.BFF.Commission.Protobuf\FrontOffice.BFF.Commission.Protobuf.csproj" />-->
<!-- <ProjectReference Include="..\..\..\FrontOffice.BFF\src\Protobufs\FrontOffice.BFF.NetworkMembership.Protobuf\FrontOffice.BFF.NetworkMembership.Protobuf.csproj" />-->
<!-- <ProjectReference Include="..\..\..\FrontOffice.BFF\src\Protobufs\FrontOffice.BFF.DiscountShop.Protobuf\FrontOffice.BFF.DiscountShop.Protobuf.csproj" />-->
<!-- <ProjectReference Include="..\..\..\FrontOffice.BFF\src\Protobufs\FrontOffice.BFF.UserWallet.Protobuf\FrontOffice.BFF.UserWallet.Protobuf.csproj" />-->
<!-- </ItemGroup>-->
<!-- -->
<ItemGroup>
<Folder Include="Components" />
</ItemGroup>
<ItemGroup>
<Content Include="..\.dockerignore">
<Link>.dockerignore</Link>
</Content>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="FourSat" value="https://git.afrino.co/api/packages/FourSat/nuget/index.json" />
<add key="Afrino" value="https://git.afrino.co/api/packages/Afrino/nuget/index.json" />
</packageSources>
<packageSourceCredentials>
<FourSat>
<add key="Username" value="masoud" />
<add key="ClearTextPassword" value="87zH26nbqT" />
</FourSat>
<Afrino>
<add key="Username" value="systemuser" />
<add key="ClearTextPassword" value="sZSA7PTiv3pUSQZ" />
</Afrino>
</packageSourceCredentials>
</configuration>

View File

@@ -1,5 +1,5 @@
{
"GwUrl": "https://fogw.kbs1.ir",
"GwUrl": "https://frontoffice-bff.foursat.afrino.co",
// "GwUrl": "https://localhost:34781",
"DownloadUrl": "https://dl.afrino.co",
"EncryptionSettings": {