Skip to content

Commit

Permalink
fix: use distorless docker container
Browse files Browse the repository at this point in the history
  • Loading branch information
Fritz (Fredrick Seitz) committed Sep 21, 2024
1 parent cfd64db commit 3e1fc51
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
10 changes: 4 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
FROM mcr.microsoft.com/dotnet/sdk:8.0-jammy AS base
USER $APP_UID
WORKDIR /app
EXPOSE 8080
EXPOSE 8081

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
FROM mcr.microsoft.com/dotnet/sdk:8.0-jammy AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["src/Bulwark.Auth/Bulwark.Auth.csproj", "src/Bulwark.Auth/"]
Expand All @@ -19,9 +19,7 @@ FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "Bulwark.Auth.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false

FROM base AS final
FROM mcr.microsoft.com/dotnet/aspnet:8.0-jammy-chiseled AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Bulwark.Auth.dll"]


ENTRYPOINT ["dotnet", "Bulwark.Auth.dll"]
6 changes: 3 additions & 3 deletions src/Bulwark.Auth/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
using MongoDB.Driver;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
//trigger build: update docker build
//trigger build: update docker build with distroless
var applicationBuilder = WebApplication.CreateBuilder(args);
DotEnv.Load(options: new DotEnvOptions(overwriteExistingVars: false));
//AppConfig must be initialized after DotEnv.Load for environment variables to be available
Expand Down Expand Up @@ -109,7 +109,7 @@
socialValidators.Add(googleValidator);
}

if (!string.IsNullOrEmpty(appConfig.MicrosoftClientId) &&
if (!string.IsNullOrEmpty(appConfig.MicrosoftClientId) &&
!string.IsNullOrEmpty(appConfig.MicrosoftTenantId))
{
var microSoftValidator = new MicrosoftValidator(appConfig.MicrosoftClientId, appConfig.MicrosoftTenantId);
Expand Down Expand Up @@ -163,4 +163,4 @@
webApplication.UseRouting();
webApplication.MapControllers();
webApplication.Run();
//end of config
//end of config

0 comments on commit 3e1fc51

Please sign in to comment.