update Dockerfile and project files for improved build process and remove documentation generation
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<GenerateDocumentationFile>false</GenerateDocumentationFile>
|
||||
<NoWarn>$(NoWarn);1591</NoWarn>
|
||||
<NuGetAudit>false</NuGetAudit>
|
||||
</PropertyGroup>
|
||||
@@ -20,9 +20,4 @@
|
||||
<ProjectReference Include="..\AccountManagement.Application.Contracts\AccountManagement.Application.Contracts.csproj" />
|
||||
<ProjectReference Include="..\_0_Framework\_0_Framework_b.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="CopyDocs" AfterTargets="Build">
|
||||
<Copy SourceFiles="$(OutputPath)CompanyManagment.App.Contracts.xml" DestinationFolder="../ServiceHost\bin\Debug\net8.0\" />
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
|
||||
80
Dockerfile
Normal file
80
Dockerfile
Normal file
@@ -0,0 +1,80 @@
|
||||
|
||||
# Multi-stage build for ASP.NET Core 10
|
||||
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
|
||||
|
||||
WORKDIR /src
|
||||
|
||||
# Copy solution and project files
|
||||
COPY ["DadmehrGostar.sln", "DadmehrGostar.sln"]
|
||||
COPY ["ServiceHost/ServiceHost.csproj", "ServiceHost/"]
|
||||
COPY ["0_Framework/0_Framework.csproj", "0_Framework/"]
|
||||
COPY ["_0_Framework/_0_Framework_b.csproj", "_0_Framework/"]
|
||||
COPY ["AccountManagement.Application/AccountManagement.Application.csproj", "AccountManagement.Application/"]
|
||||
COPY ["AccountManagement.Application.Contracts/AccountManagement.Application.Contracts.csproj", "AccountManagement.Application.Contracts/"]
|
||||
COPY ["AccountManagement.Configuration/AccountManagement.Configuration.csproj", "AccountManagement.Configuration/"]
|
||||
COPY ["AccountManagement.Domain/AccountManagement.Domain.csproj", "AccountManagement.Domain/"]
|
||||
COPY ["AccountMangement.Infrastructure.EFCore/AccountMangement.Infrastructure.EFCore.csproj", "AccountMangement.Infrastructure.EFCore/"]
|
||||
COPY ["BackgroundInstitutionContract/BackgroundInstitutionContract.Task/BackgroundInstitutionContract.Task.csproj", "BackgroundInstitutionContract/BackgroundInstitutionContract.Task/"]
|
||||
COPY ["Company.Domain/Company.Domain.csproj", "Company.Domain/"]
|
||||
COPY ["CompanyManagement.Infrastructure.Excel/CompanyManagement.Infrastructure.Excel.csproj", "CompanyManagement.Infrastructure.Excel/"]
|
||||
COPY ["CompanyManagement.Infrastructure.Mongo/CompanyManagement.Infrastructure.Mongo.csproj", "CompanyManagement.Infrastructure.Mongo/"]
|
||||
COPY ["CompanyManagment.App.Contracts/CompanyManagment.App.Contracts.csproj", "CompanyManagment.App.Contracts/"]
|
||||
COPY ["CompanyManagment.Application/CompanyManagment.Application.csproj", "CompanyManagment.Application/"]
|
||||
COPY ["CompanyManagment.EFCore/CompanyManagment.EFCore.csproj", "CompanyManagment.EFCore/"]
|
||||
COPY ["PersonalContractingParty.Config/PersonalContractingParty.Config.csproj", "PersonalContractingParty.Config/"]
|
||||
COPY ["ProgramManager/src/Application/GozareshgirProgramManager.Application/GozareshgirProgramManager.Application.csproj", "ProgramManager/src/Application/GozareshgirProgramManager.Application/"]
|
||||
COPY ["ProgramManager/src/Domain/GozareshgirProgramManager.Domain/GozareshgirProgramManager.Domain.csproj", "ProgramManager/src/Domain/GozareshgirProgramManager.Domain/"]
|
||||
COPY ["ProgramManager/src/Infrastructure/GozareshgirProgramManager.Infrastructure/GozareshgirProgramManager.Infrastructure.csproj", "ProgramManager/src/Infrastructure/GozareshgirProgramManager.Infrastructure/"]
|
||||
COPY ["Query/Query.csproj", "Query/"]
|
||||
COPY ["Query.Bootstrapper/Query.Bootstrapper.csproj", "Query.Bootstrapper/"]
|
||||
COPY ["Shared.Contracts/Shared.Contracts.csproj", "Shared.Contracts/"]
|
||||
COPY ["WorkFlow/Application/WorkFlow.Application/WorkFlow.Application.csproj", "WorkFlow/Application/WorkFlow.Application/"]
|
||||
COPY ["WorkFlow/Application/WorkFlow.Application.Contracts/WorkFlow.Application.Contracts.csproj", "WorkFlow/Application/WorkFlow.Application.Contracts/"]
|
||||
COPY ["WorkFlow/Domain/WorkFlow.Domain/WorkFlow.Domain.csproj", "WorkFlow/Domain/WorkFlow.Domain/"]
|
||||
COPY ["WorkFlow/Infrastructure/WorkFlow.Infrastructure.ACL/WorkFlow.Infrastructure.ACL.csproj", "WorkFlow/Infrastructure/WorkFlow.Infrastructure.ACL/"]
|
||||
COPY ["WorkFlow/Infrastructure/WorkFlow.Infrastructure.Config/WorkFlow.Infrastructure.Config.csproj", "WorkFlow/Infrastructure/WorkFlow.Infrastructure.Config/"]
|
||||
COPY ["WorkFlow/Infrastructure/WorkFlow.Infrastructure.EfCore/WorkFlow.Infrastructure.EfCore.csproj", "WorkFlow/Infrastructure/WorkFlow.Infrastructure.EfCore/"]
|
||||
COPY ["BackgroundJobs/BackgroundJobs.Task/BackgroundJobs.Task.csproj", "BackgroundJobs/BackgroundJobs.Task/"]
|
||||
COPY ["backService/backService.csproj", "backService/"]
|
||||
|
||||
# Restore all projects
|
||||
RUN dotnet restore "DadmehrGostar.sln"
|
||||
|
||||
# Copy source code
|
||||
COPY . .
|
||||
|
||||
# Build the ServiceHost project
|
||||
WORKDIR /src/ServiceHost
|
||||
RUN dotnet build "ServiceHost.csproj" -c Release -o /app/build
|
||||
|
||||
# Publish stage
|
||||
FROM build AS publish
|
||||
RUN dotnet publish "ServiceHost.csproj" -c Release -o /app/publish /p:UseAppHost=false
|
||||
|
||||
# Runtime stage
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS final
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install curl for health checks
|
||||
#RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Copy published app
|
||||
COPY --from=publish /app/publish .
|
||||
|
||||
# Create directories for certificates, storage, faces, and logs
|
||||
# Note: Bind-mounted directories will override these, but we create them for consistency
|
||||
RUN mkdir -p /app/certs /app/Faces /app/Storage /app/Logs app/InsuranceList && \
|
||||
chmod 777 /app/Faces /app/Storage /app/Logs app/InsuranceList && \
|
||||
chmod 755 /app/certs
|
||||
|
||||
# Expose ports
|
||||
EXPOSE 80 443
|
||||
|
||||
# Health check - check both HTTP and HTTPS
|
||||
#HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
|
||||
# CMD curl -f http://localhost:80/health || curl -f -k https://localhost:443/health || exit 1
|
||||
|
||||
# Set entry point
|
||||
ENTRYPOINT ["dotnet", "ServiceHost.dll"]
|
||||
|
||||
@@ -50,12 +50,12 @@ FROM build AS publish
|
||||
RUN dotnet publish "ServiceHost.csproj" -c Release -o /app/publish /p:UseAppHost=false
|
||||
|
||||
# Runtime stage
|
||||
FROM mcr.microsoft.com/dotnet/aspnetcore:10.0 AS final
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS final
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install curl for health checks
|
||||
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
|
||||
#RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Copy published app
|
||||
COPY --from=publish /app/publish .
|
||||
@@ -70,8 +70,8 @@ RUN mkdir -p /app/certs /app/Faces /app/Storage /app/Logs app/InsuranceList && \
|
||||
EXPOSE 80 443
|
||||
|
||||
# Health check - check both HTTP and HTTPS
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
|
||||
CMD curl -f http://localhost:80/health || curl -f -k https://localhost:443/health || exit 1
|
||||
#HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
|
||||
# CMD curl -f http://localhost:80/health || curl -f -k https://localhost:443/health || exit 1
|
||||
|
||||
# Set entry point
|
||||
ENTRYPOINT ["dotnet", "ServiceHost.dll"]
|
||||
|
||||
7
nuget.config
Normal file
7
nuget.config
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
|
||||
</packageSources>
|
||||
</configuration>
|
||||
|
||||
Reference in New Issue
Block a user