示例zeit / micro应用使用dockerpkg在小型Docker容器中运行
示例zeit / micro应用使用dockerpkg在小型Docker容器中运行
JavaScript 其它杂项
共54Star
详细介绍
dockerpkg-example
Example zeit/micro app running in small docker container using dockerpkg
Step 1: Clone the repository, install dependencies
$ git clone https://github.com/dockerpkg/dockerpkg-example.git
$ cd dockerpkg-example
$ npm install
Step 2: Run the build command
$ npm run build
This will do 2 things:
- Build the
app.bin
file using the dockerpkg/builder container - Build a new Docker container based of the dockerpkg/runner container
Step 3: There is no Step 3!
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
Credits
License
MIT
-
356 Star
-
52 Star
-
2236 Star
-
45 Star
-
216 Star
-
0 Star
-
0 Star
-
5 Star
-
33 Star