Refactoring

This commit is contained in:
Jonatan Rek committed 2026-10-31 19:16:51 +01:00
1 parent 085ab7e9b8
commit 411f7be896
29 files changed
+219 -50

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
#!/bin/sh
# Prepares .env. When /config is mounted, .env is restored from /config/.env and saved there on first creation.
cd "${APP_ROOT:-/var/www/html}" || exit 0
[ -f artisan ] || exit 0
if [ -d /config ] && [ -f /config/.env ]; then
echo "Using existing /config/.env"
cp /config/.env .env
elif [ ! -f .env ] && [ -f .env.example ]; then
echo "Creating .env from example"
cp .env.example .env
chown "$(stat -c %u:%g .env.example)" .env
if [ -d /config ]; then
cp .env /config/.env
fi
fi