allow overriding default port with environment variable for Docker
This commit is contained in:
parent
20737a1571
commit
4938eaaa44
@ -25,7 +25,20 @@ public class Program : WebApplication
|
||||
|
||||
public Dictionary<string, OmsSession> _Sessions = new Dictionary<string, OmsSession>();
|
||||
|
||||
protected override int DefaultPort => 4436;
|
||||
protected override int DefaultPort
|
||||
{
|
||||
get
|
||||
{
|
||||
if (System.Environment.GetEnvironmentVariable("OMS_SERVERPORT") != null)
|
||||
{
|
||||
if (Int32.TryParse(System.Environment.GetEnvironmentVariable("OMS_SERVERPORT"), out int port))
|
||||
{
|
||||
return port;
|
||||
}
|
||||
}
|
||||
return 4436;
|
||||
}
|
||||
}
|
||||
|
||||
public Program()
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user