-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
346 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM mcr.microsoft.com/dotnet/runtime-deps:6.0.3 | ||
|
||
# create group & user | ||
RUN addgroup --gid 1000 --system app && adduser --uid 1000 -system app --gid 1000 | ||
|
||
# create work dir and set permissions as WORKDIR sets permissions as root | ||
RUN mkdir /app && chown -R app:app /app | ||
WORKDIR /app | ||
|
||
LABEL maintainer "Digitaal Vlaanderen <[email protected]>" | ||
LABEL registry="streetname-registry" | ||
|
||
COPY / /app | ||
WORKDIR /app | ||
|
||
RUN apt-get update && \ | ||
apt-get install curl jq -y && \ | ||
chmod +x ./init.sh | ||
|
||
# switch to created user | ||
USER app | ||
|
||
ENTRYPOINT ["./init.sh"] |
37 changes: 37 additions & 0 deletions
37
src/StreetName.Snapshot.Verifier/Infrastructure/Modules/ApiModule.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
namespace StreetNameRegistry.Snapshot.Verifier.Infrastructure.Modules | ||
{ | ||
using Autofac; | ||
using Autofac.Extensions.DependencyInjection; | ||
using Microsoft.Extensions.Configuration; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Microsoft.Extensions.Logging; | ||
using StreetNameRegistry.Infrastructure; | ||
using StreetNameRegistry.Infrastructure.Modules; | ||
|
||
public class ApiModule : Module | ||
{ | ||
private readonly IConfiguration _configuration; | ||
private readonly IServiceCollection _services; | ||
private readonly ILoggerFactory _loggerFactory; | ||
|
||
public ApiModule( | ||
IConfiguration configuration, | ||
IServiceCollection services, | ||
ILoggerFactory loggerFactory) | ||
{ | ||
_configuration = configuration; | ||
_services = services; | ||
_loggerFactory = loggerFactory; | ||
} | ||
|
||
protected override void Load(ContainerBuilder builder) | ||
{ | ||
builder | ||
.RegisterModule(new CommandHandlingModule(_configuration)); | ||
|
||
builder.RegisterSnapshotModule(_configuration); | ||
|
||
builder.Populate(_services); | ||
} | ||
} | ||
} |
Oops, something went wrong.