add entry point for dev docker

This commit is contained in:
Bence Pőcze 2023-09-28 10:02:06 +02:00
parent 17633c4005
commit 47aaf3f3d6
Signed by: bence
GPG Key ID: DC5BD6E95A333E6D

View File

@ -0,0 +1,36 @@
#!/bin/bash
set -e
echo "Installing Composer packages..."
if [ -f .env ]; then
composer install
else
composer create-project
fi
echo "Installing NPM packages..."
(cd multi && npm install)
echo "Installing Yarn packages..."
(cd public/static && yarn install)
echo "Migrating DB..."
./rvr db:migrate
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 rvr
useradd --uid $USER_UID --gid $USER_GID rvr
sed -i -e "s/^user = .*$/user = rvr/g" -e "s/^group = .*$/group = rvr/g" /etc/php/7.4/fpm/pool.d/www.conf
set +e
/usr/sbin/php-fpm7.4 -F &
/usr/sbin/nginx -g 'daemon off;' &
sudo -u rvr -g rvr /usr/bin/node --inspect=0.0.0.0:9229 multi &
wait -n
exit $?