This commit is contained in:
Mikhail Kuznetsov
2023-06-01 16:42:44 +10:00
parent f0d28c0802
commit e465932222
29 changed files with 206 additions and 34 deletions

View File

@@ -0,0 +1,29 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
FROM 10.99.253.167:8090/dotnet/runtime:7.0 AS base
WORKDIR /app
FROM 10.99.253.167:8090/dotnet/sdk:7.0 AS build
WORKDIR /src
COPY ["NuGet.config", "."]
COPY ["PARR.Worker/PARR.Worker/PARR.Worker.csproj", "PARR.Worker/PARR.Worker/"]
COPY ["PARR.AIHIT/AIHIT/PARR.AIHIT.csproj", "PARR.AIHIT/AIHIT/"]
COPY ["PARR.DAL/PARR.DAL.csproj", "PARR.DAL/"]
COPY ["PARR.Mail/PARR.Mail/PARR.Mail.csproj", "PARR.Mail/PARR.Mail/"]
RUN dotnet restore "PARR.Worker/PARR.Worker/PARR.Worker.csproj"
COPY . .
WORKDIR "/src/PARR.Worker/PARR.Worker"
RUN dotnet build "PARR.Worker.csproj" -c Release -o /app/build
FROM build AS publish
ARG app_version=0.0.0-default
RUN dotnet publish "PARR.Worker.csproj" -c Release -o /app/publish /p:UseAppHost=false /p:Version=$app_version
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "PARR.Worker.dll"]
### EXAMPLE ###
# docker build -t parr-aihit-syncher:v1.0.0 --build-arg app_version=1.0.0 -f PARR.Worker/Dockerfile .

View File

@@ -5,11 +5,14 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>dotnet-PARR.Worker-87bfa085-3c62-4b97-b25f-bdece8fc03df</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<DockerfileContext>..\..</DockerfileContext>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.17.0" />
<PackageReference Include="Serilog.Extensions.Hosting" Version="7.0.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="7.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" />

View File

@@ -1,11 +1,14 @@
{
{
"profiles": {
"PARR.Worker": {
"commandName": "Project",
"dotnetRunMessages": true,
"environmentVariables": {
"DOTNET_ENVIRONMENT": "Development"
}
},
"dotnetRunMessages": true
},
"Docker": {
"commandName": "Docker"
}
}
}
}