Obsidian icon indicating copy to clipboard operation
Obsidian copied to clipboard

Add a server environment for running in Docker

Open XanderStoffels opened this issue 2 years ago • 2 comments

Currently, the default provided IServerEnvironment expects a terminal with standard input and output. When running in Docker, most of the time there is no standard input, causing the server to crash when waiting for input (Console.ReadKey, Console.ReadLine, etc).

Make a new IServerEnvironment that will be used by the console app based on a provided command line argument or environment variable. This environment should not expect any input from standard input.

XanderStoffels avatar Oct 13 '22 00:10 XanderStoffels

As of right now the server does not seem to be craching in docker for me, but it is important to at least have a version that properly runs in docker.

However I'd argue it's still good practice to prevent these issues anyway.

Docker creates a .dockerenv file in the filesystem root. Could check for that..

Naamloos avatar Oct 13 '22 09:10 Naamloos

With that I'd like to add that it may be nice to have some config vars be overrideable by environmant variables. For docker support.

Naamloos avatar Oct 13 '22 09:10 Naamloos