Some checks failed
Building and publishing Homebrewery as Docker Image / build (release) Has been cancelled
37 lines
853 B
Bash
37 lines
853 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}",
|
|
"local_environments": ["${HB_LOCAL_ENVIRONMENT:-"docker"}"]
|
|
"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 "$@"
|