set runner user of web service

This commit is contained in:
bence committed 2023-09-26 21:56:29 +02:00
1 parent fc6141e2b9
commit c7f5ea0d85
4 files changed
+22 -8

No files matched your search

+9 -1
View File
@@ -8,12 +8,20 @@ echo "Migrating DB..."
echo "Installing crontab..."
/usr/bin/crontab docker/scripts/cron
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
set +e
/usr/sbin/cron -f &
/usr/sbin/php-fpm7.4 -F &
/usr/sbin/nginx -g 'daemon off;' &
/usr/bin/node multi &
sudo -u mapg -g mapg /usr/bin/node multi &
wait -n