feat: Add Docker configuration and update deployment workflow

This commit is contained in:
masoodafar-web
2025-12-06 21:54:09 +03:30
parent f5b8052245
commit 9146391928
6 changed files with 99 additions and 16 deletions

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

@@ -8,11 +8,15 @@
<BlazorCacheBootResources>false</BlazorCacheBootResources>
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Common\NewFolder\**" />
<Content Remove="Common\NewFolder\**" />
<Content Include="..\.dockerignore">
<Link>.dockerignore</Link>
</Content>
<EmbeddedResource Remove="Common\NewFolder\**" />
<None Remove="Common\NewFolder\**" />

24
src/BackOffice/Dockerfile Normal file
View File

@@ -0,0 +1,24 @@
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
USER $APP_UID
WORKDIR /app
EXPOSE 8080
EXPOSE 8081
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["BackOffice/NuGet.config", "NuGet.config"]
COPY ["BackOffice/BackOffice.csproj", "BackOffice/"]
RUN dotnet restore "BackOffice/BackOffice.csproj" --configfile NuGet.config
COPY . .
WORKDIR "/src/BackOffice"
RUN dotnet build "./BackOffice.csproj" -c $BUILD_CONFIGURATION -o /app/build
FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "./BackOffice.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "BackOffice.dll"]

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,6 +1,6 @@
{
// "GwUrl": "https://bogw.kbs1.ir",
"GwUrl": "https://localhost:6468",
"GwUrl": "http://backoffice-bff-svc",
"Authentication": {
//"Authority": "https://localhost:5001",
"Authority": "https://ids.afrino.co/",