Skip to content

Instantly share code, notes, and snippets.

@slemeur
Created September 16, 2019 15:31
Show Gist options
  • Save slemeur/1308469dc4b8f0f9e8edcb1fa762a496 to your computer and use it in GitHub Desktop.
Save slemeur/1308469dc4b8f0f9e8edcb1fa762a496 to your computer and use it in GitHub Desktop.
sample-devfile-kubenertes-plugin
metadata:
name: wksp-hacf
projects:
- name: nodejs-mongodb-app
source:
location: 'https://github.com/gothinkster/node-express-realworld-example-app'
type: git
branch: master
attributes:
persistVolumes: 'false'
components:
- id: che-incubator/typescript/latest
memoryLimit: 512Mi
type: chePlugin
- mountSources: true
endpoints:
- name: nodejs
port: 3000
memoryLimit: 512Mi
type: dockerimage
alias: nodejs
image: 'quay.io/eclipse/che-nodejs10-ubi:nightly'
env:
- value: 220fd770-c028-480d-8f95-f84353c7d55a
name: SECRET
- value: production
name: NODE_ENV
- value: 'mongodb://user:password@mongo/db'
name: MONGODB_URI
- endpoints:
- name: mongo
attributes:
discoverable: 'true'
public: 'false'
port: 27017
memoryLimit: 512Mi
type: dockerimage
volumes:
- name: mongo-storage
containerPath: /var/lib/mongodb/data
alias: mongo
image: centos/mongodb-34-centos7
env:
- value: user
name: MONGODB_USER
- value: password
name: MONGODB_PASSWORD
- value: db
name: MONGODB_DATABASE
- value: password
name: MONGODB_ADMIN_PASSWORD
- id: ms-vscode/vscode-github-pullrequest/latest
type: chePlugin
- id: ms-kubernetes-tools/vscode-kubernetes-tools/latest
type: chePlugin
apiVersion: 1.0.0
commands:
- name: run the web app
actions:
- workdir: '${CHE_PROJECTS_ROOT}/nodejs-mongodb-app'
type: exec
command: npm install && npm run dev
component: nodejs
- name: create test user
actions:
- type: exec
command: >
curl -X POST --data '{"user": {"username": "test", "email":
"[email protected]", "password": "password"}}' -H "Content-Type:
application/json" http://localhost:3000/api/users
component: nodejs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment