Skip to content

Commit

Permalink
Add devfiles for PHP (#21)
Browse files Browse the repository at this point in the history
* Add devfiles for PHP; fix typo
  • Loading branch information
svor authored and monaka committed Jun 28, 2019
1 parent 6e1efeb commit a524e64
Show file tree
Hide file tree
Showing 9 changed files with 328 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Though you may also just provide the image to the older versions of Docker (ex.
## OpenShift
You can deploy Che devfile registry on Openshift with command.
```
oc new-app -f deploy/openshift/che-devfile-registry.yml \
oc new-app -f deploy/openshift/che-devfile-registry.yaml \
-p IMAGE="quay.io/openshiftio/che-devfile-registry" \
-p IMAGE_TAG="latest" \
-p PULL_POLICY="Always"
Expand Down
99 changes: 99 additions & 0 deletions devfiles/php-laravel/devfile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
---
apiVersion: 1.0.0
metadata:
name: php-laravel
projects:
-
name: laravel-realworld-example-app
source:
type: git
location: "/~https://github.com/gothinkster/laravel-realworld-example-app.git"
components:
-
type: chePlugin
id: redhat/php/latest
memoryLimit: 1Gi
-
type: chePlugin
id: redhat/php-debugger/latest
memoryLimit: 256Mi
-
type: dockerimage
alias: php
image: eclipse/php:7.1-che7
env:
- name: HOME
value: /home/user
- name: PS1
value: $(echo ${0})\\$
memoryLimit: 512Mi
endpoints:
- name: '8080/tcp'
port: 8080
mountSources: true
volumes:
- name: composer
containerPath: "/home/user/.composer"
-
type: dockerimage
alias: mysql
image: centos/mysql-57-centos7
env:
- name: MYSQL_USER
value: homestead
- name: MYSQL_PASSWORD
value: secret
- name: MYSQL_ROOT_PASSWORD
value: secret
- name: MYSQL_DATABASE
value: homestead
memoryLimit: 256Mi
endpoints:
- name: 'db'
port: 3306
attributes:
discoverable: "true"
mountSources: false
commands:
-
name: Start Artisan Web Server
actions:
- type: exec
component: php
command: "php artisan serve"
workdir: ${CHE_PROJECTS_ROOT}/laravel-realworld-example-app
-
name: Install dependencies
actions:
- type: exec
component: php
command: "composer install"
workdir: ${CHE_PROJECTS_ROOT}/laravel-realworld-example-app
-
name: Copy the example env file and make the required configuration changes in the .env file
actions:
- type: exec
component: php
command: "cp .env.example .env"
workdir: ${CHE_PROJECTS_ROOT}/laravel-realworld-example-app
-
name: Generate a new application key
actions:
- type: exec
component: php
command: "php artisan key:generate"
workdir: ${CHE_PROJECTS_ROOT}/laravel-realworld-example-app
-
name: Generate a new JWT authentication secret key
actions:
- type: exec
component: php
command: "php artisan jwt:generate"
workdir: ${CHE_PROJECTS_ROOT}/laravel-realworld-example-app
-
name: Run the database migrations
actions:
- type: exec
component: php
command: "php artisan migrate"
workdir: ${CHE_PROJECTS_ROOT}/laravel-realworld-example-app
6 changes: 6 additions & 0 deletions devfiles/php-laravel/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
displayName: "PHP Laravel"
description: PHP Stack with Laravel real world application
tags: ["PHP", "Apache", "MySQL"]
icon: https://www.eclipse.org/che/images/logo-eclipseche.svg
globalMemoryLimit: 2686Mi
76 changes: 76 additions & 0 deletions devfiles/php-mysql/devfile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
apiVersion: 1.0.0
metadata:
name: php-mysql
projects:
-
name: crud-php
source:
type: git
location: "/~https://github.com/taniarascia/pdo.git"
components:
-
type: chePlugin
id: redhat/php/latest
memoryLimit: 1Gi
-
type: chePlugin
id: redhat/php-debugger/latest
memoryLimit: 256Mi
-
type: dockerimage
alias: php
image: eclipse/php:7.1-che7
env:
- name: HOME
value: /home/user
- name: PS1
value: $(echo ${0})\\$
memoryLimit: 512Mi
endpoints:
- name: '8080/tcp'
port: 8080
mountSources: true
volumes:
- name: composer
containerPath: "/home/user/.composer"
-
type: dockerimage
alias: mysql
image: centos/mysql-57-centos7
env:
- name: MYSQL_USER
value: user
- name: MYSQL_PASSWORD
value: root
- name: MYSQL_ROOT_PASSWORD
value: root
- name: MYSQL_DATABASE
value: database
memoryLimit: 256Mi
endpoints:
- name: 'db'
port: 3306
attributes:
discoverable: "true"
mountSources: false
commands:
-
name: Start Apache Web Server
actions:
- type: exec
component: php
command: "service apache2 start"
-
name: Stop Apache Web Server
actions:
- type: exec
component: php
command: "service apache2 stop"
-
name: Configure database
actions:
- type: exec
component: php
command: "sed -i 's/localhost/127.0.0.1/g' config.php && php install.php"
workdir: ${CHE_PROJECTS_ROOT}/crud-php
6 changes: 6 additions & 0 deletions devfiles/php-mysql/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
displayName: "PHP MySQL"
description: PHP Stack with MySQL and simple database application
tags: ["PHP", "Apache", "MySQL"]
icon: https://www.eclipse.org/che/images/logo-eclipseche.svg
globalMemoryLimit: 2686Mi
80 changes: 80 additions & 0 deletions devfiles/php-symfony/devfile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
apiVersion: 1.0.0
metadata:
name: php-symfony
projects:
-
name: symfony-demo-application
source:
type: git
location: "/~https://github.com/symfony/demo.git"
components:
-
type: chePlugin
id: redhat/php/latest
memoryLimit: 1Gi
-
type: chePlugin
id: redhat/php-debugger/latest
memoryLimit: 256Mi
-
type: dockerimage
alias: php
image: eclipse/php:7.1-che7
env:
- name: HOME
value: /home/user
- name: PS1
value: $(echo ${0})\\$
memoryLimit: 512Mi
endpoints:
- name: '8080/tcp'
port: 8080
mountSources: true
volumes:
- name: composer
containerPath: "/home/user/.composer"
- name: symfony
containerPath: "/home/user/.symfony"
-
type: dockerimage
alias: mysql
image: centos/mysql-57-centos7
env:
- name: MYSQL_USER
value: db_user
- name: MYSQL_PASSWORD
value: db_password
- name: MYSQL_ROOT_PASSWORD
value: db_password
- name: MYSQL_DATABASE
value: db_name
memoryLimit: 256Mi
endpoints:
- name: 'db'
port: 3306
attributes:
discoverable: "true"
mountSources: false
commands:
-
name: Start Symfony Web Server
actions:
- type: exec
component: php
command: "$HOME/.symfony/bin/symfony server:start"
workdir: ${CHE_PROJECTS_ROOT}/symfony-demo-application
-
name: Install dependencies
actions:
- type: exec
component: php
command: "composer install && wget https://get.symfony.com/cli/installer -O - | bash"
workdir: ${CHE_PROJECTS_ROOT}/symfony-demo-application
-
name: Stop Symfony Web Server
actions:
- type: exec
component: php
command: "$HOME/.symfony/bin/symfony server:stop"
workdir: ${CHE_PROJECTS_ROOT}/symfony-demo-application
6 changes: 6 additions & 0 deletions devfiles/php-symfony/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
displayName: "PHP Symfony"
description: PHP Stack with Symfony Demo Application https://symfony.com/
tags: ["PHP", "Apache", "MySQL", "Symfony"]
icon: https://www.eclipse.org/che/images/logo-eclipseche.svg
globalMemoryLimit: 2686Mi
48 changes: 48 additions & 0 deletions devfiles/php-web-simple/devfile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
apiVersion: 1.0.0
metadata:
name: php-web-simple
projects:
-
name: php-web-simple
source:
type: git
location: "/~https://github.com/che-samples/web-php-simple"
components:
-
type: chePlugin
id: redhat/php/latest
memoryLimit: 1Gi
-
type: chePlugin
id: redhat/php-debugger/latest
memoryLimit: 256Mi
-
type: dockerimage
alias: php
image: eclipse/php:7.1-che7
env:
- name: HOME
value: /home/user
- name: PS1
value: $(echo ${0})\\$
memoryLimit: 512Mi
mountSources: true
volumes:
- name: composer
containerPath: "/home/user/.composer"
- name: symfony
containerPath: "/home/user/.symfony"
commands:
-
name: Start Apache Web Server
actions:
- type: exec
component: php
command: "service apache2 start"
-
name: Stop Apache Web Server
actions:
- type: exec
component: php
command: "service apache2 stop"
6 changes: 6 additions & 0 deletions devfiles/php-web-simple/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
displayName: "PHP Simple"
description: PHP Stack with PHP 7.1 and simple web application
tags: ["PHP", "Apache"]
icon: https://www.eclipse.org/che/images/logo-eclipseche.svg
globalMemoryLimit: 2430Mi

0 comments on commit a524e64

Please sign in to comment.