Deployment
v0.1
First deploy
With the binary, public/, .env and the folders in place:
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 --forceruns the migrations compiled into the binary (asmyapp, so the SQLite files belong to it).- The link makes public uploads (
storage/app/public) available at/storage/…. It is made withlnas root, becausepublic/belongs to root; the folder is made asmyapp, the owner ofstorage/. Root never needs to run the app binary here. (./myapp storage:linkmakes both in one step where one user ownspublic/andstorage/. Run as root it only adds the link to apublic/that no other user controls and leavesstorage/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 --forceruns the seeders. TheDatabaseSeederof new apps creates the demo user only underAPP_ENVlocalortesting, so in production it adds nothing; seeders of your own run as written.