Production setup

Production setup

A typical production install is nginx + PHP-FPM, a supervisor-managed queue worker and a cron entry for the scheduler.

#Install

git clone https://github.com/vivek-mistry/dbnova.git && cd dbnova
composer install --no-dev --optimize-autoloader
cp .env.example .env && php artisan key:generate
touch database/database.sqlite && php artisan migrate --force
npm ci && npm run build
php artisan dbnova:install

#Web server

  • nginx + PHP-FPM, with the document root at public/.
  • client_max_body_size 32m; (it only needs to exceed one upload chunk).
  • PHP: upload_max_filesize=32M, post_max_size=32M, memory_limit=256M for FPM. The worker can run with 128M.
  • Serve it over HTTPS. MySQL passwords are submitted through the sign-in form.

#PHP settings

  • zend.exception_ignore_args = On, so exception traces carry no call arguments.
  • display_errors = Off and APP_DEBUG=false.

#Queue worker (supervisor)

[program:dbnova-worker]
command=php /var/www/dbnova/artisan queue:work --queue=imports,exports,default --timeout=0 --tries=1
autorestart=true
stopwaitsecs=60
user=www-data
  • Give the worker a long stop grace period and use php artisan queue:restart when you deploy.
  • Don't lower DB_QUEUE_RETRY_AFTER (25 h by default); it must stay above the 24 h import timeout so an import is never picked up twice.

#Scheduler

* * * * * cd /var/www/dbnova && php artisan schedule:run >> /dev/null 2>&1

The scheduler marks imports whose worker died as interrupted and deletes expired uploads every hour.

0 views Something unclear? Open an issue on GitHub