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

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

6 7 8 9 10 11 12 13
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

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

18
cp /data/database/useragents.sqlite.example /data/database/useragents.sqlite
19 20 21

chmod -R go+w storage bootstrap/cache

22 23
docker-php-ext-install pdo pdo_mysql

24
php artisan wait:db
25 26 27
rm /data/database/useragents.sqlite
touch /data/database/useragents.sqlite
php artisan migrate:fresh
28
php artisan db:seed