File size: 932 Bytes
a29d91f
 
 
ddff827
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8a8c894
a29d91f
ddff827
8a8c894
a29d91f
 
 
8a8c894
a29d91f
 
 
8a8c894
a29d91f
 
 
ddff827
 
a29d91f
ddff827
a29d91f
 
 
60cd4ba
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh
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}"