Code Monkey home page Code Monkey logo

cakephp-ex's Introduction

CakePHP Sample App on OpenShift

This is a quickstart CakePHP application for OpenShift v3 that you can use as a starting point to develop your own application and deploy it on an OpenShift cluster.

If you'd like to install it, follow these directions.

The steps in this document assume that you have access to an OpenShift deployment that you can deploy applications on.

OpenShift Considerations

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

Security

Since the quickstarts are shared code, we had to take special consideration to ensure that security related configuration variable values are unique across applications. To accomplish this, we modified some of the configuration files. Namely we changed Security.salt and Security.cipherSeed values in the app/Config/core.php config file. Those values are now generated from the application template as CAKEPHP_SECURITY_SALT and CAKEPHP_SECURITY_CIPHER_SEED. Also the secret token is generated in the template as CAKEPHP_SECRET_TOKEN. From these values the session hashes are generated. Now instead of using the same default values, OpenShift can generate these values using the generate from logic defined within the instant application's template.

Installation:

These steps assume your OpenShift deployment has the default set of ImageStreams defined. Instructions for installing the default ImageStreams are available here. If you are defining the set of ImageStreams now, remember to pass in the proper cluster-admin credentials and to create the ImageStreams in the 'openshift' namespace.

  1. Deploy the PHP application + MySQL from the provided template

     $ oc process -f https://raw.githubusercontent.com/nmalvankar/cakephp-ex/master/openshift/templates/cakephp-mysql-template.yaml | oc apply -f -
    
  2. Once the build is running, watch your build progress

     $ oc logs -f bc/cakephp-example
    
  3. Wait for cakephp-example and mysql pods to start up (this can take a few minutes):

     $ oc get pods -w
    

    Sample output:

        NAME                               READY   STATUS      RESTARTS   AGE
     	cakephp-mysql-example-1-build      0/1     Completed   0          48m
     	cakephp-mysql-example-1-cdj8j      1/1     Running     0          47m
     	cakephp-mysql-example-1-deploy     0/1     Completed   0          47m
     	cakephp-mysql-example-1-hook-pre   0/1     Completed   0          47m
     	mysql-1-2xbvk                      1/1     Running     0          48m
     	mysql-1-deploy                     0/1     Completed   0          48m
    
  4. Check the IP and port the cakephp-example & mysql services are running on:

     $ oc get svc
    

    Sample output:

        NAME                    TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)    AGE
     	cakephp-mysql-example   ClusterIP   172.21.235.170   <none>        8080/TCP   50m
     	mysql                   ClusterIP   172.21.39.200    <none>        3306/TCP   50m
    

In this case, the IP for cakephp-example is 172.21.235.170 and it is on port 8080.
Note: you can also get this information from the web console.

Source repository layout

You do not need to change anything in your existing PHP project's repository. However, if these files exist they will affect the behavior of the build process:

  • composer.json

    List of dependencies to be installed with composer. The format is documented here.

Compatibility

This repository is compatible with PHP 5.6 and higher, excluding any alpha or beta versions.

License

This code is dedicated to the public domain to the maximum extent permitted by applicable law, pursuant to CC0.

cakephp-ex's People

Contributors

bparees avatar gabemontero avatar nmalvankar avatar jhadvig avatar hhorak avatar cuppett avatar coreydaley avatar luciddreamz avatar guangxuli avatar rhcarvalho avatar mfojtik avatar pi-victor avatar adambkaplan avatar danmcp avatar phracek avatar rhamilto avatar sallyom avatar sjenning avatar dinhxuanvu avatar yselkowitz avatar ewolinetz avatar jupierce avatar liangxia avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.