diff --git a/resources/environments/.env.example b/resources/environments/.env.example index 5e0d4e6d..d75caf18 100644 --- a/resources/environments/.env.example +++ b/resources/environments/.env.example @@ -11,7 +11,7 @@ DB_PASSWORD=secret ELASTICSEARCH_HOSTS=localhost SESSION_HTTPS_ONLY=false -QUEUE_DRIVER=sync +QUEUE_DRIVER=beanstalkd MAIL_DRIVER=smtp MAIL_HOST=mailtrap.io diff --git a/resources/environments/.env.local b/resources/environments/.env.local index 42c8fe39..9bbe7fa0 100644 --- a/resources/environments/.env.local +++ b/resources/environments/.env.local @@ -8,8 +8,10 @@ DB_DATABASE=homestead DB_USERNAME=homestead DB_PASSWORD=secret +ELASTICSEARCH_HOSTS=localhost + SESSION_HTTPS_ONLY=false -QUEUE_DRIVER=sync +QUEUE_DRIVER=beanstalkd MAIL_DRIVER=smtp MAIL_HOST=mailtrap.io diff --git a/vagrant/copy-and-restart-configs.sh b/vagrant/copy-and-restart-configs.sh index d4f2ab93..9d49afdd 100755 --- a/vagrant/copy-and-restart-configs.sh +++ b/vagrant/copy-and-restart-configs.sh @@ -1,14 +1,19 @@ #!/usr/bin/env bash +echo "Updating config files and restarting services..." +echo + mkdir -p /vagrant/storage/app/datastore -sudo cp /vagrant/vagrant/pony.fm.nginx.config /etc/nginx/nginx.conf -sudo cp /vagrant/vagrant/pony.fm.nginx.site.config /etc/nginx/sites-enabled/pony.fm +sudo cp /vagrant/vagrant/pony.fm.nginx.config /etc/nginx/nginx.conf & +sudo cp /vagrant/vagrant/pony.fm.nginx.site.config /etc/nginx/sites-enabled/pony.fm & +sudo cp /vagrant/vagrant/php-overrides.ini /etc/php/7.0/fpm/99-overrides.ini & +sudo cp /vagrant/vagrant/pony.fm.redis.config /etc/redis/redis.conf & +sudo cp /vagrant/vagrant/pony.fm.supervisor.config /etc/supervisor/conf.d/pony.fm.conf & +wait -sudo cp /vagrant/vagrant/php-overrides.ini /etc/php/7.0/fpm/99-overrides.ini - -sudo cp /vagrant/vagrant/pony.fm.redis.config /etc/redis/redis.conf - -sudo service elasticsearch restart -sudo service nginx restart -sudo service php7.0-fpm restart +sudo supervisorctl update & +sudo service elasticsearch restart & +sudo service nginx restart & +sudo service php7.0-fpm restart & +wait diff --git a/vagrant/pony.fm.supervisor.config b/vagrant/pony.fm.supervisor.config new file mode 100644 index 00000000..c014c64d --- /dev/null +++ b/vagrant/pony.fm.supervisor.config @@ -0,0 +1,9 @@ +[program: ponyfm-worker] +process_name = %(program_name)s_%(process_num)02d +command = php /vagrant/artisan queue:listen --queue=default,notifications,indexing --sleep=3 --tries=3 +autostart = true +autorestart = true +user = www-data +numprocs = 4 +redirect_stderr = true +stdout_logfile = /vagrant/storage/logs/worker.log