Skip to content

Deploy with Forge

JP Barbosa edited this page Mar 16, 2016 · 5 revisions

Deploy with Forge

Add bower install and gulp --production to composer.json
nano composer.json
...
    "scripts": {
        ...
        "compile": [
            "./node_modules/.bin/bower install",
            "./node_modules/.bin/gulp --production"
        ]
    },
    ...
composer update
Create Forge server
open https://forge.laravel.com/servers

Create Forge server

Wait for this e-mail message
Your Laravel Forge server has been provisioned!

...

Server Details:

Name: YOUR_SERVER_NAME
IP Address: YOUR_SERVER_IP
Username: forge
Sudo Password: YOUR_SUDO_PASSWORD
Database Username: forge
Database Password: YOUR_DB_PASSWORD
Create site

Create site

Link to GitHub repository

Link to GitHub repository

Set .env variables

Set .env variables

APP_DEBUG=false
APP_ENV=production
APP_KEY=YOUR_APP_KEY
APP_LOG=syslog
APP_URL=http://laravel-apz.domain
CACHE_DRIVER=redis
HOST_NAME=laravel-apz.domain
DB_CONNECTION=mysql
DB_DATABASE=forge
DB_HOST=localhost
DB_PASSWORD=YOUR_DB_PASSWORD
DB_USERNAME=forge
MAIL_DRIVER=smtp
MAIL_HOST=YOUR_MAIL_HOST
MAIL_PORT=YOUR_MAIL_PORT
MAIL_USERNAME=YOUR_MAIL_USERNAME
MAIL_PASSWORD=YOUR_MAIL_PASSWORD
[email protected]
MAIL_NAME="Laravel Apz"
QUEUE_DRIVER=redis
RECAPTCHA_PUBLIC_KEY=YOUR_RECAPTCHA_PUBLIC_KEY
RECAPTCHA_PRIVATE_KEY=YOUR_RECAPTCHA_PUBLIC_KEY
REDIS_HOST=localhost
SESSION_DRIVER=file
WEATHER_APPID=YOUR_WEATHER_APPID
Change deploy script

Change deploy script

cd /home/forge/default
git pull origin master
npm install
composer install --no-interaction --no-dev --prefer-dist
composer compile --no-interaction --no-dev
php artisan migrate --force
Add worker with Redis to process queues

Add worker with Redis to process queues

Add scheduler to run commands on every hour

Add scheduler to run commands on every hour

Get Papertrail host
open https://papertrailapp.com/systems/setup

Get Papertrail host

Add Papertrail to Forge server

Add Papertrail to Forge server

Next step: Update README
Clone this wiki locally