diff options
author | Daniel Weipert <code@drogueronin.de> | 2023-11-22 17:51:25 +0100 |
---|---|---|
committer | Daniel Weipert <code@drogueronin.de> | 2023-11-22 17:51:25 +0100 |
commit | 10a7516603d50a7b094ae5ff0102d018b11d7c5f (patch) | |
tree | 0a74e618b8972f4e795d861d4110cf04e88735d5 | |
parent | b51d8c76dd49f6474c1299742ff9d41462fa9dca (diff) |
[Docker] add document server environment variables
-rw-r--r-- | docker/server/server.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/docker/server/server.php b/docker/server/server.php index dee0cd8..f9bb22a 100644 --- a/docker/server/server.php +++ b/docker/server/server.php @@ -14,6 +14,11 @@ $server = new Server( '0.0.0.0' ); -$server->onRequest(new DocumentServer(__DIR__ . '/content')); +$server->onRequest(new DocumentServer( + documentRoot: realpath($_ENV['SERVER_DOCUMENT_ROOT'] ?? './content'), + indexFile: $_ENV['SERVER_INDEX_FILE'] ?? 'index.gmi', + useDirectoryListing: boolval($_ENV['SERVER_USE_DIRECTORY_LISTING'] ?? false) +)); + $server->listen(); |