docker files
This commit is contained in:
parent
fddd354772
commit
d62a7d6e39
4 changed files with 37 additions and 4 deletions
16
LoadBalancerProject-DONT-IMPORT-INTO-UNITY/Dockerfile
Normal file
16
LoadBalancerProject-DONT-IMPORT-INTO-UNITY/Dockerfile
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
FROM mcr.microsoft.com/dotnet/sdk:5.0-alpine AS builder
|
||||||
|
WORKDIR /lrm
|
||||||
|
COPY . .
|
||||||
|
RUN [\
|
||||||
|
"dotnet", "publish", \
|
||||||
|
"--output", "/build/", \
|
||||||
|
"--configuration", "Release",\
|
||||||
|
"--no-self-contained", \
|
||||||
|
"." ]
|
||||||
|
|
||||||
|
FROM mcr.microsoft.com/dotnet/runtime:5.0-alpine
|
||||||
|
WORKDIR /lrm-lb
|
||||||
|
COPY --from=builder /build/ .
|
||||||
|
ENV LRM_LB_CONFIG_PATH="/config/config-load-balancer.json"
|
||||||
|
CMD [ "./LRM_LoadBalancer" ]
|
||||||
|
ENTRYPOINT [ "./LRM_LoadBalancer" ]
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
@ -18,7 +18,7 @@ namespace LightReflectiveMirror.LoadBalancing
|
||||||
|
|
||||||
private int _pingDelay = 10000;
|
private int _pingDelay = 10000;
|
||||||
const string API_PATH = "/api/stats";
|
const string API_PATH = "/api/stats";
|
||||||
const string CONFIG_PATH = "config.json";
|
readonly string CONFIG_PATH = System.Environment.GetEnvironmentVariable("LRM_LB_CONFIG_PATH") ?? "config.json";
|
||||||
|
|
||||||
public static Config conf;
|
public static Config conf;
|
||||||
public static Program instance;
|
public static Program instance;
|
||||||
|
|
|
||||||
17
ServerProject-DONT-IMPORT-INTO-UNITY/Dockerfile
Normal file
17
ServerProject-DONT-IMPORT-INTO-UNITY/Dockerfile
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
FROM mcr.microsoft.com/dotnet/sdk:5.0-alpine AS builder
|
||||||
|
WORKDIR /lrm
|
||||||
|
COPY . .
|
||||||
|
RUN [\
|
||||||
|
"dotnet", "publish", \
|
||||||
|
"--output", "/build/", \
|
||||||
|
"--configuration", "Release",\
|
||||||
|
"--no-self-contained", \
|
||||||
|
"." ]
|
||||||
|
|
||||||
|
FROM mcr.microsoft.com/dotnet/runtime:5.0-alpine
|
||||||
|
WORKDIR /lrm
|
||||||
|
COPY --from=builder /build/ .
|
||||||
|
COPY ./MultiCompiled.dll .
|
||||||
|
ENV LRM_CONFIG_PATH="/config/config.json"
|
||||||
|
CMD [ "./LRM" ]
|
||||||
|
ENTRYPOINT [ "./LRM" ]
|
||||||
|
|
@ -37,7 +37,7 @@ namespace LightReflectiveMirror
|
||||||
|
|
||||||
private UdpClient _punchServer;
|
private UdpClient _punchServer;
|
||||||
|
|
||||||
private const string CONFIG_PATH = "config.json";
|
private readonly string CONFIG_PATH = System.Environment.GetEnvironmentVariable("LRM_CONFIG_PATH") ?? "config.json";
|
||||||
|
|
||||||
public static void Main(string[] args) => new Program().MainAsync().GetAwaiter().GetResult();
|
public static void Main(string[] args) => new Program().MainAsync().GetAwaiter().GetResult();
|
||||||
|
|
||||||
|
|
@ -67,7 +67,7 @@ namespace LightReflectiveMirror
|
||||||
WriteLogMessage("Loading Assembly... ", ConsoleColor.White, true);
|
WriteLogMessage("Loading Assembly... ", ConsoleColor.White, true);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var asm = Assembly.LoadFile(Directory.GetCurrentDirectory() + @"\" + conf.TransportDLL);
|
var asm = Assembly.LoadFile(Path.GetFullPath(conf.TransportDLL));
|
||||||
WriteLogMessage($"OK", ConsoleColor.Green);
|
WriteLogMessage($"OK", ConsoleColor.Green);
|
||||||
|
|
||||||
WriteLogMessage("\nLoading Transport Class... ", ConsoleColor.White, true);
|
WriteLogMessage("\nLoading Transport Class... ", ConsoleColor.White, true);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue