Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jonfairbanks/docker-node-app
A sample Node.js app in Docker
https://github.com/jonfairbanks/docker-node-app
arm docker-node dockerfile kubernetes kubernetes-node node-js
Last synced: 11 days ago
JSON representation
A sample Node.js app in Docker
- Host: GitHub
- URL: https://github.com/jonfairbanks/docker-node-app
- Owner: jonfairbanks
- License: gpl-3.0
- Created: 2019-02-10T03:37:36.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-07-20T12:12:33.000Z (over 1 year ago)
- Last Synced: 2024-11-07T17:53:35.485Z (2 months ago)
- Topics: arm, docker-node, dockerfile, kubernetes, kubernetes-node, node-js
- Language: CSS
- Homepage:
- Size: 1.07 MB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# docker-node-app
![Docker+Node](https://raw.githubusercontent.com/jonfairbanks/docker-node-app/master/logo.jpg)
[![CI - Main](https://github.com/jonfairbanks/docker-node-app/actions/workflows/ci-main.yaml/badge.svg?branch=master)](https://github.com/jonfairbanks/docker-node-app/actions/workflows/ci-main.yaml)
[![CI - Development](https://github.com/jonfairbanks/docker-node-app/actions/workflows/ci-develop.yaml/badge.svg?branch=develop)](https://github.com/jonfairbanks/docker-node-app/actions/workflows/ci-develop.yaml)
![GitHub top language](https://img.shields.io/github/languages/top/jonfairbanks/docker-node-app.svg)
![Docker Pulls](https://img.shields.io/docker/pulls/jonfairbanks/docker-node-app.svg)
![GitHub last commit](https://img.shields.io/github/last-commit/jonfairbanks/docker-node-app.svg)
![Lines of code](https://img.shields.io/tokei/lines/github/jonfairbanks/docker-node-app)
![License](https://img.shields.io/github/license/jonfairbanks/docker-node-app.svg?style=flat)## 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](https://www.aquasec.com/news/microscanner-new-free-image-vulnerability-scanner-for-developers/)
- Properly handles `SIGINT` and `SIGTERM` events with [tini](https://github.com/krallin/tini)
- Follows many development, virtualization and styling best-practices### Docker
This application is also available on [Dockerhub](https://hub.docker.com/r/jonfairbanks/docker-node-app).
To launch the container:
`docker run -d -p 8080:8080 --name docker-node-app jonfairbanks/docker-node-app:latest`To attach to a running container:
`docker exec -it docker-node-app /bin/ash`### Kubernetes
You can find this app on [Helm](https://jonfairbanks.github.io/helm-charts/)!
This application can also be helpful verifying Kubernetes:
- Scaling and Downtime Mitigation
- Cluster Load Balancing
- Request IP PassthroughFor 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`