File tree Expand file tree Collapse file tree 4 files changed +33
-1
lines changed Expand file tree Collapse file tree 4 files changed +33
-1
lines changed Original file line number Diff line number Diff line change 1+ FROM mono:latest
2+ WORKDIR /container
3+ ADD . /container
4+
5+ CMD ["mono" , "./InEngine.exe" , "-s" ]
Original file line number Diff line number Diff line change 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" >
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
Original file line number Diff line number Diff line change 11using System ;
22using System . IO ;
33using System . ServiceProcess ;
4+ using Mono . Unix ;
5+ using Mono . Unix . Native ;
46
57namespace 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 ) ;
Original file line number Diff line number Diff line change 1+ version : ' 3'
2+ services :
3+ inengine :
4+ image : inengine
5+ redis :
6+ image : " redis:alpine"
You can’t perform that action at this time.
0 commit comments