clamstew / expressjs-docker

Express.js microservice with a Dockerfile, Kubernetes YAMLs and a non-root user

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Express.js Docker example

Example to show how to build a microservice with Node.js and Express.js with instructions for: OpenFaaS, Docker and Kubernetes

Created for k33g (Philippe Charrière) from GitLab

Run it with OpenFaaS and PLONK

PLONK = Prometheus Linkerd (optional) OpenFaaS NATS and Kubernetes

faas-cli deploy

Access via URL on faas-cli describe service

Run it with docker

docker run --name expressjs -p 8080:8080 -ti alexellis2/service:0.3.0

Access from localhost:8080

Try it with Kubernetes

kubectl apply -f ./yaml
kubectl port-forward deploy/expressjs 8080:8080 &

curl 127.0.0.1:8080

The parts

Templates

With OpenFaaS Templates you don't need to bother with managing Dockerfiles and TCP-port bindings, unless you like that sort of thing, then you can do that too just like we did in this example.

Try one of the templates above with faas-cli template store ls/pull.

About

Express.js microservice with a Dockerfile, Kubernetes YAMLs and a non-root user


Languages

Language:JavaScript 54.6%Language:Dockerfile 45.4%