Obsidian
Obsidian copied to clipboard
Add a server environment for running in Docker
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.
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..
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.