Recreated plugin with new project template. Started implementing server system daemon
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
using Docker.DotNet;
|
||||
using MoonlightServers.Daemon.ServerSystem.Abstractions;
|
||||
|
||||
namespace MoonlightServers.Daemon.ServerSystem.Implementations.Docker;
|
||||
|
||||
public static class Extensions
|
||||
{
|
||||
public static void AddDockerServices(this IServiceCollection collection)
|
||||
{
|
||||
var client = new DockerClientBuilder()
|
||||
.WithEndpoint(new Uri("unix:///var/run/docker.sock"))
|
||||
.Build();
|
||||
|
||||
collection.AddSingleton(client);
|
||||
|
||||
collection.AddSingleton<DockerEventService>();
|
||||
collection.AddHostedService(sp => sp.GetRequiredService<DockerEventService>());
|
||||
|
||||
collection.AddSingleton<IRuntimeEnvironmentService, DockerRuntimeEnvService>();
|
||||
collection.AddSingleton<IInstallEnvironmentService, DockerInstallEnvService>();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user