Skip to content

Instantly share code, notes, and snippets.

@dulao5
Last active December 25, 2021 07:55
Show Gist options
  • Save dulao5/d3d2401d73f21be295702f97291344d2 to your computer and use it in GitHub Desktop.
Save dulao5/d3d2401d73f21be295702f97291344d2 to your computer and use it in GitHub Desktop.
che-ticlick-devfiles
apiVersion: 1.0.0
metadata:
generateName: php-tidb-
projects:
- name: crud-php
source:
type: git
location: 'https://github.com/che-samples/php-mysql'
components:
- type: chePlugin
id: bmewburn/vscode-intelephense-client/latest
- type: chePlugin
id: felixfbecker/php-debug/latest
- type: dockerimage
alias: php
image: 'quay.io/eclipse/che-php-7@sha256:9e75e4202a53defd59a3901a569cfcee7269dbe31a9a6866e8c6d98aaa799b17'
memoryLimit: 512Mi
endpoints:
- name: 8080-tcp
port: 8080
mountSources: true
volumes:
- name: composer
containerPath: /home/user/.composer
- type: dockerimage
alias: tidb
image: 'pingcap/tidb:v5.1.3'
memoryLimit: 1000Mi
endpoints:
- attributes:
discoverable: 'true'
public: 'false'
name: db
port: 4000
mountSources: true
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: Restart Apache Web Server
actions:
- type: exec
component: php
command: service apache2 restart
- name: Configure database
actions:
- type: exec
component: php
command: 'sed -i ''s/localhost/127.0.0.1:4000/g'' config.php && php install.php'
workdir: '${CHE_PROJECTS_ROOT}/crud-php'
- name: Configure Apache Web Server DocumentRoot
actions:
- type: exec
component: php
command: |
if grep -q '/projects$' /etc/apache2/sites-available/000-default.conf; then
sed -i 's|DocumentRoot /projects|DocumentRoot /projects/crud-php/public|' /etc/apache2/sites-available/000-default.conf
else
echo "DocumentRoot already configured!"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment