Download entrypoint.sh from lifedebugger/CAPS04-FE-REFACTOR-2: direct link, hf CLI and curl.
- Browser
- Download file 932 Bytes
-
https://huggingface.co/spaces/lifedebugger/CAPS04-FE-REFACTOR-2/resolve/main/entrypoint.sh
- Command line
-
hf download hf://spaces/lifedebugger/CAPS04-FE-REFACTOR-2/entrypoint.sh
-
curl -L -o entrypoint.sh https://huggingface.co/spaces/lifedebugger/CAPS04-FE-REFACTOR-2/resolve/main/entrypoint.sh
932 Bytes
| set -e | |
| env | while IFS='=' read -r KEY VALUE; do | |
| case "$KEY" in | |
| *_FILE) | |
| VAR_NAME="${KEY%_FILE}" | |
| # kalau ENV biasa sudah ada jangan overwrite | |
| if [ -n "$(printenv "$VAR_NAME")" ]; then | |
| continue | |
| fi | |
| if [ -f "$VALUE" ]; then | |
| export "$VAR_NAME=$(tr -d '\r\n' < "$VALUE")" | |
| fi | |
| ;; | |
| esac | |
| done | |
| # HF compatibility | |
| if [ -n "$SPACE_HOST" ] && [ "${APP_URL:-}" = "http://localhost" ]; then | |
| export APP_URL="https://$SPACE_HOST" | |
| fi | |
| if [ -n "$SPACE_HOST" ] && [ -z "${ASSET_URL:-}" ]; then | |
| export ASSET_URL="https://$SPACE_HOST" | |
| fi | |
| if [ -z "${APP_KEY:-}" ]; then | |
| export APP_KEY=$(php artisan key:generate --show --no-interaction) | |
| fi | |
| rm -f bootstrap/cache/config.php | |
| php artisan config:clear | |
| php artisan cache:clear | |
| exec php artisan serve \ | |
| --host=0.0.0.0 \ | |
| --port="${PORT:-7860}" | |