Add examples for nodejs and image

This commit is contained in:
Sambo Chea 2021-03-29 15:01:53 +07:00
parent 032ff3555a
commit 981a8399ad
7 changed files with 44 additions and 0 deletions

0
.gitignore vendored Normal file
View File

2
examples/README.md Normal file
View File

@ -0,0 +1,2 @@
# Examples
- Say Hello to Docker with Nodejs

3
examples/sayhello/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
node_modules/
yarn.lock
package-lock.json

View 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"]

View 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

View File

@ -0,0 +1,7 @@
const sayHello = () => {
console.log("sayHello => ", "Hi, I'm from CUBETIQ Solution!");
return Math.random();
}
console.log(sayHello())

View 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"
}