-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·40 lines (32 loc) · 776 Bytes
/
Copy pathrun.sh
File metadata and controls
executable file
·40 lines (32 loc) · 776 Bytes
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
#!/bin/sh
# Run setup only if .env file doesn't exist.
if [ ! -e .env.production ]
then
cat > .env.production << EOF
APP_NAME=MyIdlers
APP_ENV=production
APP_DEBUG=false
APP_KEY=
LOG_CHANNEL=stderr
DB_CONNECTION=mysql
DB_HOST=${DB_HOST}
DB_PORT=${DB_PORT:-3306}
DB_DATABASE=${DB_DATABASE}
DB_USERNAME=${DB_USERNAME}
DB_PASSWORD=${DB_PASSWORD}
APP_URL=${APP_URL}
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_CONNECTION=sync
EOF
php artisan key:generate --no-interaction --force
fi
# Clear and cache config for production
php artisan config:cache
php artisan route:cache
php artisan view:cache
# Run migrations if AUTO_MIGRATE is set
if [ "${AUTO_MIGRATE}" = "true" ]; then
php artisan migrate --force
fi
php artisan serve --host=0.0.0.0 --port=8000 --env=production