Sign inSign up

jonfairbanks/docker-node-app

By jonfairbanks

Updated 6 days ago

A sample Node.js app in Docker

Image
0

100K+

jonfairbanks/docker-node-app repository overview

docker-node-app

Docker+Node

Docker Cloud Automated build Docker Cloud Build Status GitHub top language Docker Pulls GitHub last commit Dependabot Status License

A sample Node.js app in Docker

  • Final Image Size: ~70MB
  • Includes the latest versions of Node, NPM and Yarn
  • Runs as a non-root user for enhanced security
  • Multi-stage including development, test, audit and production environments
  • Scan and audit dependencies with Microscanner
  • Properly handles SIGINT and SIGTERM events with tini
  • Follows many development, virtualization and styling best-practices
Docker

This application is also available on Dockerhub.

To launch the container: docker run -d -p 8080:8080 --name docker-node-app jonfairbanks/docker-node-app

To attach to a running container: docker exec -it docker-node-app /bin/ash

Kubernetes

You can find this app on Helm!

This application can also be helpful verifying Kubernetes:

  • Scaling and Downtime Mitigation
  • Cluster Load Balancing
  • Request IP Passthrough

For testing that pods are balancing correctly, you can make multiple requests to your app to verify.

To make 50 requests and write them to a file, you can run the following with your endpoint: for run in {1..50}; do curl -sSL -D - kube.fairbanks.dev -o /dev/null | grep X-Hostname; done

ARM Support

This application also has an experimental jonfairbanks/docker-node-app:buildx tag which supports both x86 and ARM based platforms. For more details, checkout the ARM Documentation.

Tag summary

Content type

Image

Digest

sha256:cf944b1e8

Size

62.2 MB

Last updated

6 days ago

docker pull jonfairbanks/docker-node-app