Update package build process, add .env template, and update to Cloudron base 5.0.0

This commit is contained in:
Andreas Düren
2025-03-17 09:04:47 +01:00
parent 167128b6a7
commit bd4dea4757
4 changed files with 39 additions and 9 deletions

View File

@@ -1,8 +1,23 @@
#!/bin/bash
set -e
# Source environment variables (if the file exists)
[ -f /app/.env ] && source /app/.env || echo "No .env file found, using default environment variables"
# Check and create .env file if it doesn't exist
if [ ! -f /app/data/.env ]; then
echo "Creating default .env file..."
cp /app/.env.template /app/data/.env
chown elasticsearch:elasticsearch /app/data/.env
chmod 600 /app/data/.env
fi
# Load environment variables from .env file if it exists
if [ -f /app/data/.env ]; then
echo "Loading environment variables from .env file..."
set -o allexport
source /app/data/.env
set +o allexport
else
echo "No .env file found, using default environment variables"
fi
# Set constants
ES_HOME=/usr/share/elasticsearch