Example zeit/micro app running in small docker container using dockerpkg
$ git clone https://github.com/dockerpkg/dockerpkg-example.git $ cd dockerpkg-example $ npm install $ npm run build This will do 2 things:
- Build the
app.binfile using the dockerpkg/builder container - Build a new Docker container based of the dockerpkg/runner container
You have just created a <50 MB Docker image that runs your application.
Run the container using this command:
$ docker run -p 3000:3000 -it --name dockerpkg-example --rm dockerpkg/dockerpkg-example:latest Verify that it works:
$ curl localhost:3000 You can stop the running container using this command:
$ docker stop dockerpkg-example MIT