2023-09-16 15:06:11 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
echo "Migrating DB..."
|
|
|
|
./mapg db:migrate
|
|
|
|
|
|
|
|
echo "Installing crontab..."
|
|
|
|
/usr/bin/crontab docker/scripts/cron
|
|
|
|
|
2023-09-26 21:39:49 +02:00
|
|
|
echo "Set runner user based on owner of .env..."
|
|
|
|
USER_UID=$(stat -c "%u" .env)
|
|
|
|
USER_GID=$(stat -c "%g" .env)
|
|
|
|
groupadd --gid $USER_GID mapg
|
|
|
|
useradd --uid $USER_UID --gid $USER_GID mapg
|
|
|
|
chown mapg:mapg cache
|
|
|
|
sed -i -e "s/^user = .*$/user = mapg/g" -e "s/^group = .*$/group = mapg/g" /etc/php/7.4/fpm/pool.d/www.conf
|
|
|
|
|
2023-09-16 15:06:11 +02:00
|
|
|
set +e
|
|
|
|
|
|
|
|
/usr/sbin/cron -f &
|
|
|
|
/usr/sbin/php-fpm7.4 -F &
|
|
|
|
/usr/sbin/nginx -g 'daemon off;' &
|
2023-09-26 21:39:49 +02:00
|
|
|
sudo -u mapg -g mapg /usr/bin/node multi &
|
2023-09-16 15:06:11 +02:00
|
|
|
|
|
|
|
wait -n
|
|
|
|
|
|
|
|
exit $?
|