init.sh 902 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
if [ ! -f "/data/.env" ]; then
    cp /data/.env.example /data/.env
fi

Davide Aprea's avatar
Davide Aprea committed
10
11
if [ ! -f "/data/config/sumas.json" ]; then
    cp /data/config/sumas.json.example /data/config/sumas.json
Davide Aprea's avatar
Davide Aprea committed
12
13
fi

Davide Aprea's avatar
Davide Aprea committed
14
15
if [ ! -f "/data/config/sumasEn.json" ]; then
    cp /data/config/sumas.json.example /data/config/sumasEn.json
Davide Aprea's avatar
Davide Aprea committed
16
17
fi

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

22
23
24
25
if [ ! -d "/data/storage/logs/metager" ]; then
    mkdir -p /data/storage/logs/metager
fi

26
cp /data/database/useragents.sqlite.example /data/database/useragents.sqlite
27
28
29

chmod -R go+w storage bootstrap/cache

30
31
docker-php-ext-install pdo pdo_mysql

32
php artisan wait:db
33
34
35
rm /data/database/useragents.sqlite
touch /data/database/useragents.sqlite
php artisan migrate:fresh
36
php artisan db:seed