homebrewery-docker/entrypoint.sh
Florian Weber 81fd807a71
All checks were successful
Building and publishing Homebrewery as Docker Image / build (release) Successful in 11m42s
Removed tini because it seems to not work on arm devices
2025-06-26 09:53:18 +02:00

36 lines
791 B
Bash

#!/bin/sh
set -e
CONFIG_FILE="/usr/src/app/config/docker.json"
# Falls Verzeichnis noch nicht existiert
mkdir -p /usr/src/app/config
# Falls docker.json noch nicht existiert
if [ ! -f "$CONFIG_FILE" ]; then
echo "Creating docker.json from environment..."
cat > "$CONFIG_FILE" <<EOF
{
"host": "${HB_HOST}",
"web_port": ${PORT},
"naturalcrit_url": "${HB_NATURALCRIT_URL}",
"secret": "${HB_SECRET}",
"enable_v3": ${HB_ENABLE_V3:-true},
"enable_themes": ${HB_ENABLE_THEMES:-true},
"publicUrl": "${HB_PUBLIC_URL}",
"mongodb_uri": "${HB_DB_URI}",
"hb_images": ${HB_IMAGES:-null},
"hb_fonts": ${HB_FONTS:-null}
}
EOF
else
echo "docker.json already exists, skipping creation."
fi
# Start Homebrewery
echo "Starting Homebrewery..."
exec /usr/local/bin/npm start "$@"