Smeltery
Get started

Deployment

v0.1

First deploy

With the binary, public/, .env and the folders in place:

shell
cd /srv/myapp
sudo -u myapp ./myapp migrate --force
sudo -u myapp install -d -m 750 storage/app storage/app/public
[ -L public/storage ] || sudo ln -s ../storage/app/public public/storage
  • migrate --force runs the migrations compiled into the binary (as myapp, so the SQLite files belong to it).
  • The link makes public uploads (storage/app/public) available at /storage/…. It is made with ln as root, because public/ belongs to root; the folder is made as myapp, the owner of storage/. Root never needs to run the app binary here. (./myapp storage:link makes both in one step where one user owns public/ and storage/. Run as root it only adds the link to a public/ that no other user controls and leaves storage/ alone; it never opens the log file.) Deploys keep the link (the deploy script below excludes it), and the [ -L … ] test makes running these lines again change nothing.
  • sudo -u myapp ./myapp db:seed --force runs the seeders. The DatabaseSeeder of new apps creates the demo user only under APP_ENV local or testing, so in production it adds nothing; seeders of your own run as written.

↑↓ moveEnter openEsc close