Coder Social home page Coder Social logo

example's Introduction

node-starter

Why? test change.

I see it's hard & time consuming when deploy node app into production docker, especially with npm install

Features

Node.js preconfig

Fast Docker Build

How it works

  • build src => lib
  • install production dependencies only in docker (use strategy in this article to leverage cache)
  • copy lib & package.json into docker

How it cache

  • If you don't change dependencies (for example: yarn add ...) => it just build src => lib & copy the lib directory into docker. Building time is same as normal npm build
  • It you change devDependencies => it works like statement above
  • If you change dependencies, it will leverage yarn-cache and only install the dependency you just add. And it's just take some seconds to do this

Requirement

  • Node.js
  • Docker

Getting started

  • git clone https://github.com/joehua87/node-starter.git
  • yarn
  • ./build.sh
  • Test that it's work properly: docker run --rm joehua/node-starter node lib/bin/run.js
  • Modify src/bin/run.js
  • ./build.sh
  • Run this again: docker run --rm joehua/node-starter node lib/bin/run.js
  • You will see that the image is up to date, and build time is blazing fast

example's People

Contributors

joehua87 avatar ptloc1992 avatar seangels avatar

Watchers

 avatar  avatar

example's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.