Skip to content

Commit

Permalink
fix: missing aspnet runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
chgl committed Mar 20, 2021
1 parent 64c64a4 commit 8d57135
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ FROM build AS test
WORKDIR /build/src/FhirServerExporter.Tests
RUN dotnet test -p:CollectCoverage=true

FROM mcr.microsoft.com/dotnet/runtime:5.0-alpine
FROM mcr.microsoft.com/dotnet/aspnet:5.0-alpine
WORKDIR /opt/fhir-server-exporter
COPY --from=build /build/publish .

Expand Down
24 changes: 13 additions & 11 deletions src/FhirServerExporter/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,22 @@ static IHostBuilder CreateHostBuilder(string[] args) =>
services.AddHostedService<FhirExporter>();
var config = ctx.Configuration;
var oAuthUri = config.GetValue<Uri>("Auth:OAuth:TokenUrl");
if (oAuthUri != null)
services.AddAccessTokenManagement(options =>
{
services.AddAccessTokenManagement(options =>
var oauthUri = config.GetValue<Uri>("Auth:OAuth:TokenUrl")?.AbsoluteUri;
if (oauthUri == null)
{
options.Client.Clients.Add("default", new()
{
Address = oAuthUri.AbsoluteUri,
ClientId = config.GetValue<string>("Auth:OAuth:ClientId"),
ClientSecret = config.GetValue<string>("Auth:OAuth:ClientSecret"),
Scope = config.GetValue<string>("Auth:OAuth:Scope"),
});
return;
}
options.Client.Clients.Add("default", new()
{
Address = oauthUri,
ClientId = config.GetValue<string>("Auth:OAuth:ClientId"),
ClientSecret = config.GetValue<string>("Auth:OAuth:ClientSecret"),
Scope = config.GetValue<string>("Auth:OAuth:Scope"),
});
}
});
})
.ConfigureLogging(builder =>
builder.AddSimpleConsole(options =>
Expand Down

0 comments on commit 8d57135

Please sign in to comment.