From 678570a363057bebecca4d70a352557d5003ed37 Mon Sep 17 00:00:00 2001 From: zoxexivo Date: Wed, 13 Jul 2022 22:07:31 +0300 Subject: [PATCH] update packages --- build/Jobs.Dockerfile | 20 ++++++++++++++++++++ src/Backend/Geen.Jobs/Geen.Jobs.csproj | 19 +++++++++++++++++++ src/Backend/Geen.Jobs/Program.cs | 19 +++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 build/Jobs.Dockerfile create mode 100644 src/Backend/Geen.Jobs/Geen.Jobs.csproj create mode 100644 src/Backend/Geen.Jobs/Program.cs diff --git a/build/Jobs.Dockerfile b/build/Jobs.Dockerfile new file mode 100644 index 0000000..89b9e23 --- /dev/null +++ b/build/Jobs.Dockerfile @@ -0,0 +1,20 @@ +ARG BUILD_NUMBER + +FROM geen-frontend:$BUILD_NUMBER as frontend + +FROM mcr.microsoft.com/dotnet/sdk:6.0.300-alpine3.14-amd64 AS build + +WORKDIR /app + +COPY ./src/Backend/ ./ + +WORKDIR /app/Geen.Jobs + +COPY --from=frontend /app/dist wwwroot + +RUN dotnet publish -c Release -o /app/out -r linux-musl-x64 --self-contained true /p:PublishReadyToRun=true /p:PublishSingleFile=true --packages packages + +FROM mcr.microsoft.com/dotnet/runtime-deps:6.0.5-alpine3.14-amd64 AS runtime +WORKDIR /app +COPY --from=build /app/out . +ENTRYPOINT ["./Geen.Web"] diff --git a/src/Backend/Geen.Jobs/Geen.Jobs.csproj b/src/Backend/Geen.Jobs/Geen.Jobs.csproj new file mode 100644 index 0000000..22b5c12 --- /dev/null +++ b/src/Backend/Geen.Jobs/Geen.Jobs.csproj @@ -0,0 +1,19 @@ + + + + Exe + net6.0 + enable + enable + + + + + + + + + + + + diff --git a/src/Backend/Geen.Jobs/Program.cs b/src/Backend/Geen.Jobs/Program.cs new file mode 100644 index 0000000..141b08f --- /dev/null +++ b/src/Backend/Geen.Jobs/Program.cs @@ -0,0 +1,19 @@ +using Geen.Jobs.Application.Jobs; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Logging; + +await Host.CreateDefaultBuilder(args) + .ConfigureServices(services => + { + services.AddHostedService(); + }) + .ConfigureLogging(builder => + { + builder.ClearProviders() + .AddFilter("Microsoft", LogLevel.Error) + .AddFilter("System", LogLevel.Error) + .AddConsole(); + }) + .Build() + .RunAsync(); \ No newline at end of file