An open API service indexing awesome lists of open source software.

https://github.com/acanguven/node-docker-multi-stage-pipeline

Nodejs multi-stage Dockerfile for secure, lean and fast images.
https://github.com/acanguven/node-docker-multi-stage-pipeline

docker dockerfile nodejs

Last synced: 4 months ago
JSON representation

Nodejs multi-stage Dockerfile for secure, lean and fast images.

Awesome Lists containing this project

README

          

# Docker Multi-Stage NodeJs Pipeline

Example implementation of Docker multi-stage pipeline for Nodejs

One of the challenges facing Nodejs developers is providing a reliable build, test, prepare for production pipeline.

To solve this issue we use Docker multi-stage pipeline. Check out [Dockerfile](./Dockerfile) for better understanding

## [Multi-stage pipeline](./Dockerfile)
### no-cache run
```bash
time docker build . -t optimized --no-cache
```
* Duration: 57.856 seconds
* Image Size: 73MB

### cache run (source file changed)
```bash
time docker build . -t optimized
```
* Duration: 10.790 seconds
* Image Size: 73MB

## [Unoptimized pipeline](./Dockerfile_unoptimized)
### no-cache run
```bash
time docker build -f Dockerfile_unoptimized . -t unoptimized --no-cache
```
* Duration: 41.761 seconds
* Image Size: 374MB

### cache run (source file changed)
```bash
time docker build -f Dockerfile_unoptimized . -t unoptimized
```
* Duration: 12.372 seconds
* Image Size: 374MB