Skip to content

Latest commit

 

History

History
43 lines (30 loc) · 2 KB

README.md

File metadata and controls

43 lines (30 loc) · 2 KB

Phase Blog Demo

▲ Deploy to Vercel (formerly ZEIT)

Here is a minimal Phase blog theme heavily inspired by the Gatsby Lumen.

This project comes out of the box with Phase & Tailwind and is based on the latest Laravel 7.x version


Deployment with Vercel

Some slight modifications have been made to the base laravel install to make this work on Vercel. In the AppServiceProvider a few things have been added to make the Vercel deploy slightly smoother.

The most important thing to note is the new VERCEL_DEMO_MODE environment variable added to now.json which sets the APP_KEY on every request. This is needed for the initial deploy to work as there is no way to set environment variables prior to deploy. It is highly encouraged to add an APP_KEY as soon as possible, without this some parts of laravel may not work as expected.

Also you may notice that we are creating some directories in the boot method. This is due to the fact that Vercel deploys are read-only with the exception of the /tmp directory and so any temporary files such as the ones required for Vue.js Server Side Rendering will be created there.

Other key things to take note of if you are new to Vercel are the environment variables set are set in now.json. Some are as you would expect such as APP_ENV & APP_URL, however any secrets (such as APP_KEY) should be set using Vercels Environment Variables.

Docker setup

The image can be built using the existing docker-compose config.

docker-composer build

To start the server

docker-composer up -d

To stop

docker-composer down

To pass arguments through

docker-composer exec laravel npm run hot
docker-composer exec laravel composer install
docker-composer exec laravel php artisan migrate