• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

dockerfile/nodejs-bower-gulp-runtime: Node.js w/ Bower & Gulp runtime Docker ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

dockerfile/nodejs-bower-gulp-runtime

开源软件地址(OpenSource Url):

https://github.com/dockerfile/nodejs-bower-gulp-runtime

开源编程语言(OpenSource Language):

Shell 100.0%

开源软件介绍(OpenSource Introduction):

Node.js w/ Bower & Gulp runtime Dockerfile

This repository contains Dockerfile of Node.js w/ Bower & Gulp runtime for Docker's automated build published to the public Docker Hub Registry.

This image is a base image for easily running Node.js application.

It can automatically bundle a Node.js application with its dependencies and set the default command with no additional Dockerfile instructions.

This project heavily borrowed code from Google's google/nodejs-runtime Docker image.

Base Docker Image

Installation

  1. Install Docker.

  2. Download automated build from public Docker Hub Registry: docker pull dockerfile/nodejs-bower-gulp-runtime

    (alternatively, you can build an image from Dockerfile: docker build -t="dockerfile/nodejs-bower-gulp-runtime" github.com/dockerfile/nodejs-bower-gulp-runtime)

Usage

This image assumes that your application:

  • has a file named package.json listing its dependencies.
  • has a file named bower.json listing its dependencies.
  • has a file named Gulpfile.js registering build task.
  • has a file named server.js as the entrypoint script or define in package.json the attribute: "scripts": {"start": "node <entrypoint_script_js>"}
  • listens on port 8080

When building your application docker image, ONBUILD triggers install NPM module dependencies of your application using npm install.

  • Step 1: Create a Dockerfile in your Node.js application directory with the following content:
    FROM dockerfile/nodejs-bower-gulp-runtime
  • Step 2: Build your container image by running the following command in your application directory:
    docker build -t="app" .
  • Step 3: Run application by mapping port 8080:
    APP=$(docker run -d -p 8080 app)
    PORT=$(docker port $APP 8080 | awk -F: '{print $2}')
    echo "Open http://localhost:$PORT/"



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap