Skip to content

Latest commit

 

History

History
90 lines (60 loc) · 4.98 KB

readme.md

File metadata and controls

90 lines (60 loc) · 4.98 KB

Laravel 5.2 Quickstart on Digital Garage

Laravel is a free, open source PHP web application framework, designed for the development of model–view–controller (MVC) web applications.

This quickstart was created to make it easy to get started with Laravel 5.2 on Digital Garage.

The simplest way to install this application is to use the Digital Garage quickstart template. To install the quickstart, follow these directions.

Installation

  1. Create an account at http://www.thedigitalgarage.io/free-signup

  2. Install the Digital Garage CLI tools

  3. Add the Laravel template(s) to your project:

    $ oc create -f https://raw.githubusercontent.com/thedigitalgarage/laravel-ex/master/openshift/templates/qs-laravel-mysql.json
    

    or

    $ oc create -f https://raw.githubusercontent.com/thedigitalgarage/laravel-ex/master/openshift/templates/qs-laravel-postgresql.json
    

    or

    $ oc create -f https://raw.githubusercontent.com/thedigitalgarage/laravel-ex/master/openshift/templates/qs-laravel-sqlite.json
    
  4. Fork this GitHub repo

  5. From the web console, select your project, click Add to Project, and select the Laravel template under the PHP heading

  6. Replace the user name in the Git Repository URL parameter with your GitHub user name to point the template to your fork

  7. Scroll to the bottom of the page and click [ Create ] to deploy your application

  8. Follow these instructions to configure automated builds, allowing you to push your code to your GitHub repo and automatically trigger a new deployment

Digital Garage Considerations

These are some special considerations you may need to keep in mind when running your application on Digital Garage.

Local vs. Remote Development

This Laravel quickstart provides separate configuration files for both local and remote development. Use .env for local development, and .s2i/environment for remote development.

Remote Development

Your application is configured to automatically use an Digital Garage MySQL, PostgreSQL, or SQLite database in when deployed on Digital Garage using the included templates (see openshift/templates).

Additionally, your APP_ENV, APP_URL, and APP_KEY can be set by following the installation instructions with the included templates.

Laravel Migrations

The php artisan migrate --force command is automatically executed during deployment when using any of the included templates (see openshift/templates).

Composer

During the build process, composer install is automatically executed over the root directory. See the PHP 5.6 builder image for more details, or more specifically see here.

'Development' Mode

By default, this Quickstart is configured in 'development' mode to make debugging your application easier.

When you develop your Laravel application in Digital Garage, you can also enable the 'production' environment by setting environment variables, using the oc client, like:

$ oc get services
NAME                     CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE
laravel-mysql-example   172.30.79.234   <none>        8080/TCP   23m
$ oc set env dc/laravel-mysql-example LARAVEL_APP_ENV=production LARAVEL_APP_DEBUG=false OPCACHE_REVALIDATE_FREQ=2

Next, run oc status to confirm that an updated deployment has been kicked off.

For more information on environment variables impacting PHP behavior on Digital Garage, see the PHP 5.6 builder image.

For more information on Laravel environment variables, see the Laravel environment configuration documentation.

Log Files

Your application is configured to use the Digital Garage log directory. You can use the oc logs command to stream the latest log file entries from your running pod:

$ oc get pods
NAME                             READY     STATUS      RESTARTS   AGE
laravel-mysql-example-1-build   0/1       Completed   0          26m
laravel-mysql-example-1-hj2k1   1/1       Running     0          23m
$ oc logs laravel-mysql-example-1-hj2k1

To stop tailing the logs, press Ctrl + c.

Additional Resources

Documentation for the Laravel framework can be found on the Laravel website. Check out Digital Garage's Documentation for help running PHP on Digital Garage.