Add examples for nodejs and image
This commit is contained in:
parent
032ff3555a
commit
981a8399ad
0
.gitignore
vendored
Normal file
0
.gitignore
vendored
Normal file
2
examples/README.md
Normal file
2
examples/README.md
Normal file
@ -0,0 +1,2 @@
|
||||
# Examples
|
||||
- Say Hello to Docker with Nodejs
|
3
examples/sayhello/.gitignore
vendored
Normal file
3
examples/sayhello/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
node_modules/
|
||||
yarn.lock
|
||||
package-lock.json
|
10
examples/sayhello/Dockerfile
Normal file
10
examples/sayhello/Dockerfile
Normal file
@ -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"]
|
11
examples/sayhello/Makefile
Normal file
11
examples/sayhello/Makefile
Normal file
@ -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
|
7
examples/sayhello/index.js
Normal file
7
examples/sayhello/index.js
Normal file
@ -0,0 +1,7 @@
|
||||
const sayHello = () => {
|
||||
console.log("sayHello => ", "Hi, I'm from CUBETIQ Solution!");
|
||||
|
||||
return Math.random();
|
||||
}
|
||||
|
||||
console.log(sayHello())
|
11
examples/sayhello/package.json
Normal file
11
examples/sayhello/package.json
Normal file
@ -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