Skip to content

Instantly share code, notes, and snippets.

@jarifibrahim
Created November 20, 2018 11:19
Show Gist options
  • Save jarifibrahim/072f8a8489ac81c4e98a7170da7467f1 to your computer and use it in GitHub Desktop.
Save jarifibrahim/072f8a8489ac81c4e98a7170da7467f1 to your computer and use it in GitHub Desktop.
Nodejs with Postgres database
{
"name": "Nodejs Postgres Stack",
"components": [],
"tags": [
"Nodejs",
"Postgres"
],
"id": "stackgk84089624ggoip2",
"workspaceConfig": {
"defaultEnv": "default",
"environments": {
"default": {
"machines": {
"database": {
"attributes": {
"memoryLimitBytes": "1147483648"
},
"servers": {
"postgres": {
"attributes": {},
"port": "5432",
"protocol": "tcp"
}
},
"volumes": {},
"installers": [
"org.eclipse.che.exec",
"org.eclipse.che.terminal"
],
"env": {
"POSTGRESQL_ADMIN_PASSWORD": "adminpassword",
"POSTGRESQL_DATABASE": "my_data",
"POSTGRESQL_USER": "user",
"POSTGRESQL_PASSWORD": "password"
}
},
"nodejs": {
"attributes": {
"memoryLimitBytes": "1147483648"
},
"servers": {
"node": {
"attributes": {},
"port": "8080",
"protocol": "http"
}
},
"volumes": {},
"installers": [
"org.eclipse.che.exec",
"org.eclipse.che.terminal",
"org.eclipse.che.ls.js-ts",
"org.eclipse.che.ws-agent"
],
"env": {}
}
},
"recipe": {
"type": "openshift",
"content": "kind: List\nitems:\n - \n apiVersion: v1\n kind: Pod\n metadata:\n name: nodejs-postgres-pod\n annotations:\n org.eclipse.che.container.nodejs.machine_name: nodejs\n org.eclipse.che.container.database.machine_name: database\n spec:\n containers:\n - \n image: eclipse/node\n name: nodejs\n ports:\n - \n containerPort: 8080\n protocol: TCP\n resources:\n limits:\n memory: 3072Mi\n - \n image: \u0027registry.centos.org/postgresql/postgresql:9.6\u0027\n name: database\n ports:\n - \n containerPort: 5432\n protocol: TCP\n resources:\n limits:\n memory: 3072Mi\n env:\n - \n name: POSTGRESQL_USER\n value: user\n - \n name: POSTGRESQL_PASSWORD\n value: password\n - \n name: POSTGRESQL_DATABASE\n value: my_data\n - \n name: POSTGRESQL_ADMIN_PASSWORD\n value: adminpassword\n",
"contentType": "text/x-yaml"
}
}
},
"projects": [],
"name": "default",
"attributes": {},
"commands": [
{
"commandLine": "cd ${current.project.path} \u0026\u0026 npm install \u0026\u0026 node .",
"name": "Run",
"attributes": {
"goal": "Run",
"previewUrl": "${server.node}"
},
"type": "custom"
}
],
"links": []
},
"description": "Nodejs stack with Postgres",
"creator": "che",
"scope": "general",
"links": [
{
"href": "http://che-mini-che.192.168.42.178.nip.io/api/stack/stackgk84089624ggoip2",
"parameters": [],
"rel": "remove stack",
"method": "DELETE"
},
{
"href": "http://che-mini-che.192.168.42.178.nip.io/api/stack/stackgk84089624ggoip2",
"parameters": [],
"rel": "get stack by id",
"method": "GET",
"produces": "application/json"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment