2021-07-23 16:10:31 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
echo "> Configure logs"
|
|
|
|
mkdir -p /var/log/{apache2,nginx,pgadmin,postgresql}
|
|
|
|
chown postgres:adm /var/log/postgresql -R
|
|
|
|
chown root:postgres /var/log/postgresql
|
|
|
|
|
|
|
|
echo "> Configure volumes"
|
|
|
|
[ -e /web/frontend/node_modules ] || ln -s /web/node /web/frontend/node_modules
|
|
|
|
[ -e /web/backend/var ] || ln -s /web/var /web/backend/var
|
|
|
|
[ -e /web/backend/vendor ] || ln -s /web/vendor /web/backend/vendor
|
|
|
|
|
|
|
|
echo "> Starting php8.0-fpm server"
|
|
|
|
[ -e /etc/php/8.0/fpm/conf.d/20-xdebug.ini ] && rm /etc/php/8.0/fpm/conf.d/20-xdebug.ini || echo OK
|
|
|
|
[ -e /etc/php/8.0/cli/conf.d/20-xdebug.ini ] && rm /etc/php/8.0/cli/conf.d/20-xdebug.ini || echo OK
|
|
|
|
cp /web/config/php8.0/xdebug-fpm.ini /etc/php/8.0/fpm/conf.d/20-xdebug.ini
|
|
|
|
cp /web/config/php8.0/xdebug-cli.ini /etc/php/8.0/cli/conf.d/20-xdebug.ini
|
|
|
|
service php8.0-fpm start
|
|
|
|
|
|
|
|
echo "> Starting nginx server"
|
|
|
|
service nginx start
|
|
|
|
|
|
|
|
echo "> Starting apache2 server for pgAdmin4"
|
|
|
|
service apache2 start
|
|
|
|
|
|
|
|
echo "> Starting postgresql database"
|
|
|
|
service postgresql start
|
|
|
|
|
|
|
|
echo "> Starting ssh server"
|
|
|
|
service ssh start
|
|
|
|
|
|
|
|
echo "> Configure database"
|
|
|
|
su postgres -c psql postgres < /web/config/postgres/init-data.sql
|
|
|
|
|
|
|
|
echo "> Configure symfony"
|
|
|
|
cd /web/backend
|
2021-07-23 17:26:59 +00:00
|
|
|
composer install
|
|
|
|
php bin/console doctrine:schema:update --force
|
2021-07-23 16:10:31 +00:00
|
|
|
|
|
|
|
echo "> Configure angular"
|
|
|
|
cd /web/frontend
|
2021-07-23 17:26:59 +00:00
|
|
|
npm ci
|
2021-07-23 16:10:31 +00:00
|
|
|
|
|
|
|
echo "> Starting angular"
|
2021-07-23 19:21:40 +00:00
|
|
|
ng serve --disable-host-check --host 0.0.0.0 --poll
|