From 10a7516603d50a7b094ae5ff0102d018b11d7c5f Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Wed, 22 Nov 2023 17:51:25 +0100 Subject: [Docker] add document server environment variables --- docker/server/server.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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(); -- cgit v1.2.3