init.sh 556 Bytes
Newer Older
1
2
#!/bin/sh

3
4
5
6
# This commands will help initialize data for docker-compose setup
# Its supposed to run in a php docker image
docker-php-ext-install pdo pdo_mysql

7
8
9
10
11
12
13
14
if [ ! -f "/data/.env" ]; then
    cp /data/.env.example /data/.env
fi

if [ -f "/data/database/useragents.sqlite" ]; then
    rm /data/database/useragents.sqlite
fi

15
16
17
18
if [ ! -d "/data/storage/logs/metager" ]; then
    mkdir -p /data/storage/logs/metager
fi

19
20
21
22
23
24
25
touch /data/database/useragents.sqlite

chmod -R go+w storage bootstrap/cache

php artisan wait:db
php artisan migrate
php artisan db:seed