• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

luciddreamz/laravel-ex: Laravel Example for OpenShift 3

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

luciddreamz/laravel-ex

开源软件地址(OpenSource Url):

https://github.com/luciddreamz/laravel-ex

开源编程语言(OpenSource Language):

PHP 95.5%

开源软件介绍(OpenSource Introduction):

Laravel 5.2 Quickstart on OpenShift

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 OpenShift v3.

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

Installation

  1. Create an account at http://www.openshift.com/devpreview/register.html

  2. Install the OpenShift CLI tools

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

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

    or

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

    or

    $ oc create -f https://raw.githubusercontent.com/luciddreamz/laravel-ex/master/openshift/templates/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

OpenShift Considerations

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

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 OpenShift MySQL, PostgreSQL, or SQLite database in when deployed on OpenShift 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 OpenShift, 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 OpenShift, 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 OpenShift 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 OpenShift's Documentation for help running PHP on OpenShift.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap