Add examples for nodejs and image
This commit is contained in:
parent
032ff3555a
commit
981a8399ad
|
@ -0,0 +1,2 @@
|
|||
# Examples
|
||||
- Say Hello to Docker with Nodejs
|
|
@ -0,0 +1,3 @@
|
|||
node_modules/
|
||||
yarn.lock
|
||||
package-lock.json
|
|
@ -0,0 +1,10 @@
|
|||
FROM cubetiq/calpine-node:latest
|
||||
LABEL maintainer="sombochea@cubetiqs.com"
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
COPY . /usr/src/app
|
||||
|
||||
RUN yarn
|
||||
|
||||
CMD [ "node" , "index.js"]
|
|
@ -0,0 +1,11 @@
|
|||
DOCKER_IMAGE=cubetiq/node-sayHello
|
||||
|
||||
build:
|
||||
@echo "Building docker image..."
|
||||
docker build . -t ${DOCKER_IMAGE}
|
||||
|
||||
run:
|
||||
@echo "Running container..."
|
||||
docker run --rm -t ${DOCKER_IMAGE}
|
||||
|
||||
.PHONY: build run
|
|
@ -0,0 +1,7 @@
|
|||
const sayHello = () => {
|
||||
console.log("sayHello => ", "Hi, I'm from CUBETIQ Solution!");
|
||||
|
||||
return Math.random();
|
||||
}
|
||||
|
||||
console.log(sayHello())
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"name": "sayhello",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "Sambo Chea <sombochea@cubetiqs.com>",
|
||||
"license": "MIT"
|
||||
}
|
Loading…
Reference in New Issue
Block a user