This is a very simple, bare-bones NodeJS and ExpressJS project created for you to use with Docker.
- Install dependencies:
npm install
- Run server:
node server.js
By default, the application should be loaded on localhost:8080
. It should provide an HTTP 200 response when loaded at localhost:8080/health
.
- Build image:
docker build .
- Run container with image:
docker run {image_id}
whereimage_id
can be retrieved by runningdocker images
and found under the columnIMAGE ID
- Remove container:
docker kill {container_id}
wherecontainer_id
can be retrieved by runningdocker ps
and found under the columnCONTAINER ID
kubectl apply -f deployment.yaml
kubectl apply -f service.yaml
kubectl get pods
kubectl get services
kubectl describe services
kubectl exec -it podid bash