CureNet/docker/startup.sh

45 lines
1.3 KiB
Bash
Raw Normal View History

2021-07-23 13:26:47 +00:00
#!/bin/bash
2021-07-23 16:08:09 +00:00
echo "> Configure logs"
2021-07-23 13:26:47 +00:00
mkdir -p /var/log/{apache2,nginx,pgadmin,postgresql}
2021-07-23 16:08:09 +00:00
chown postgres:adm /var/log/postgresql -R
chown root:postgres /var/log/postgresql
2021-07-23 13:26:47 +00:00
2021-07-23 16:08:09 +00:00
echo "> Configure volumes"
2021-07-23 13:26:47 +00:00
[ -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
2021-07-23 16:08:09 +00:00
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
2021-07-23 13:26:47 +00:00
service php8.0-fpm start
2021-07-23 16:08:09 +00:00
echo "> Starting nginx server"
2021-07-23 13:26:47 +00:00
service nginx start
2021-07-23 16:08:09 +00:00
echo "> Starting apache2 server for pgAdmin4"
2021-07-23 13:26:47 +00:00
service apache2 start
2021-07-23 16:08:09 +00:00
echo "> Starting postgresql database"
2021-07-23 13:26:47 +00:00
service postgresql start
2021-07-23 16:08:09 +00:00
echo "> Starting ssh server"
2021-07-23 13:26:47 +00:00
service ssh start
2021-07-23 16:08:09 +00:00
echo "> Configure database"
2021-07-23 13:26:47 +00:00
su postgres -c psql postgres < /web/config/postgres/init-data.sql
2021-07-23 16:08:09 +00:00
echo "> Configure symfony"
2021-07-23 13:26:47 +00:00
cd /web/backend
composer install
2021-07-23 16:08:09 +00:00
echo "> Configure angular"
2021-07-23 13:26:47 +00:00
cd /web/frontend
npm i
2021-07-23 16:08:09 +00:00
echo "> Starting angular"
2021-07-23 13:26:47 +00:00
ng serve