Mikhus / ts-docker

Minimalist TypeScript/Node Docker Example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Minimalist TypeScript/Node Docker Example

This repo provides an example of building minimalist docker build for TypeScript/NodeJS based microservice.

So the most interesting part is to observe:

Dockerfile represents 3-stage building process. First phase is to run ts/node build under a target platform, which is based on Alpine Linux. Second phase compress generated binary executable using gzexe. Third, and the last phase creates a release image containing only minimalist Alpine image, pre-built compressed binary of microservice and working gzip/gzexe commands.

package.json provides a basic command set to automate local and docker builds of microservice.

With current docker build implementation it results into 27.1 MB image size production, which includes 18.4 MB pre-built compressed ts/node microservice binary inside, which results into 21.6 MB compressed docker image size for pulling.

Is it possible to have less?

Author would be greatly appreciated for any suggestions and contributions of further optimizations and improvements to this example.

License

ISC License

About

Minimalist TypeScript/Node Docker Example

License:ISC License


Languages

Language:Dockerfile 57.8%Language:TypeScript 42.2%