Skip to content

Instantly share code, notes, and snippets.

@sparkoo
Created October 27, 2019 23:13
Show Gist options
  • Save sparkoo/62386a1c74d22a8560d05cbfe24d8fa0 to your computer and use it in GitHub Desktop.
Save sparkoo/62386a1c74d22a8560d05cbfe24d8fa0 to your computer and use it in GitHub Desktop.
Preview URL example with Symphony app
---
apiVersion: 1.0.1-beta
metadata:
generateName: php-symfony-previewurl-
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: quay.io/eclipse/che-php-7:nightly
memoryLimit: 512Mi
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
previewUrl:
port: 8000
path: /en/admin/post
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment