Skip to content

Commit b5f4ea2

Browse files
committed
Merge branch '3.4-dev-dockersupport' into develop
2 parents 702c1d1 + 505e58e commit b5f4ea2

File tree

4 files changed

+33
-1
lines changed

4 files changed

+33
-1
lines changed

src/InEngine/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM mono:latest
2+
WORKDIR /container
3+
ADD . /container
4+
5+
CMD ["mono", "./InEngine.exe", "-s"]

src/InEngine/InEngine.csproj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
<ItemGroup>
3131
<Reference Include="System.ServiceProcess" />
3232
<Reference Include="System.Configuration.Install" />
33+
<Reference Include="Mono.Posix" />
3334
</ItemGroup>
3435
<ItemGroup>
3536
<None Update="Install.ps1">
@@ -50,6 +51,12 @@
5051
<None Update="Plugins\README.md">
5152
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
5253
</None>
54+
<None Update="Dockerfile">
55+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
56+
</None>
57+
<None Update="docker-compose.yml">
58+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
59+
</None>
5360
</ItemGroup>
5461
</Project>
5562

src/InEngine/Program.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
using System;
22
using System.IO;
33
using System.ServiceProcess;
4+
using Mono.Unix;
5+
using Mono.Unix.Native;
46

57
namespace InEngine
68
{
@@ -20,7 +22,19 @@ static void Main(string[] args)
2022
public static void RunScheduler()
2123
{
2224
var isRunningUnderMono = Type.GetType("Mono.Runtime") != null;
23-
if (!Environment.UserInteractive && !isRunningUnderMono)
25+
26+
if (isRunningUnderMono) {
27+
var serverHost = new ServerHost();
28+
serverHost.Start();
29+
Console.WriteLine("CTRL+C to exit.");
30+
UnixSignal.WaitAny(new[] {
31+
new UnixSignal(Signum.SIGINT),
32+
new UnixSignal(Signum.SIGTERM),
33+
new UnixSignal(Signum.SIGQUIT),
34+
new UnixSignal(Signum.SIGHUP)
35+
});
36+
}
37+
else if (!Environment.UserInteractive && !isRunningUnderMono)
2438
{
2539
// Set current working directory as services use the system directory by default.
2640
Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory);

src/InEngine/docker-compose.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: '3'
2+
services:
3+
inengine:
4+
image: inengine
5+
redis:
6+
image: "redis:alpine"

0 commit comments

Comments
 (0)