Skip to content

Build and run node apps in small docker containers using zeit/pkg

License

Notifications You must be signed in to change notification settings

daliborgogic/dockerpkg

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dockerpkg

Build and run node apps in small containers using docker and zeit/pkg.

Introduction

zeit/pkg is a tool to package a NodeJS project into an executable. The resulting packages can be used on a system without having to install NodeJS, npm or the project dependencies.

When used together with a small system like Alpine Linux this can result in simple and minimal Docker images.

This project aims for a very simple workflow to create these small images. It does so by separating the process of building and running the container and it provides a simple helper command to run the build.

Components

dockerpkg/builder

The builder image is based on mhart/alpine-node:10.3.0 and it runs the pkg command with some params in the mounted directory.

The result is a generated binary called app.bin in the mounted directory (generally this is the dir of you project).

dockerpkg/runner

The runner images is based on alpine:3.7 and it is made to run the generated app.bin from the /app directory.

dockerpkg cli tool

The dockerpkg is a simple script that executes the docker command with the right parameters to created a build.

It pulls the dockerpkg/runner images and makes sure that the working dir is mounted correctly.

How to use

Please refer to dockerpkg-example for a working example.

Credits

LICENSE

MIT

About

Build and run node apps in small docker containers using zeit/pkg

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%