From d68e7f45b3efb4ba09dc5f0ffe771c4e6a3152b2 Mon Sep 17 00:00:00 2001 From: lubiana Date: Fri, 27 Jun 2025 23:44:10 +0200 Subject: [PATCH] add env config --- public/index.php | 7 ++++++- uuid.container | 15 +++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 uuid.container diff --git a/public/index.php b/public/index.php index 985381b..142ee5c 100644 --- a/public/index.php +++ b/public/index.php @@ -6,4 +6,9 @@ use App\App; require_once __DIR__ . '/../vendor/autoload.php'; -new App('https://uuid.php.fail/')->run(); +$base = getenv('BASE_URL'); +if (!is_string($base) || $base === '') { + $base = 'https://uuid.php.fail/'; +} + +new App($base)->run(); diff --git a/uuid.container b/uuid.container new file mode 100644 index 0000000..5536318 --- /dev/null +++ b/uuid.container @@ -0,0 +1,15 @@ +[Unit] +Description=UUID + +[Container] +Image=git.hannover.ccc.de/lubiana/uuid:latest +PublishPort=127.0.0.1:8001:8001 +Environment=SERVER_NAME=:8001 +Environment=BASE_URL=https://uuid.php.fail/ +AutoUpdate=registry + +[Service] +Restart=always + +[Install] +WantedBy=default.target \ No newline at end of file