Giter Site home page Giter Site logo

dockerized-nodejs-shared-dependencies's Introduction

overview

Demo multi-container local development setup for node.js applications using a shared volume with a file watcher to add externally managed dependencies to a canned build image.

quickstart

$ git clone gh:knksmith57/dockerized-nodejs-shared-dependencies \
    dockerized-nodejs-shared-dependencies \
  && cd $_

$ docker-compose up

how it works

  1. build container is designed to simulate a black box dev tool image capable of performing webpack builds
  2. dependencies container runs a process watcher that install npm dependencies any time the local package.json file changes
  3. a shared volume is mounted between the build and dependencies containers. dependencies installs node_modules into it, and build is able to load those installed packages because the volume is mounted at /node_modules, which the built-in node.js module loader will load from.

In this particular example, style-loader and css-loader are not provided by the black box dev tool image. Instead, the host application specifies them as devDependencies in its package.json.

The webpack process, running inside the build container, is configured to use these loaders via webpack.config.js, and resolves those package dependencies to /node_modules/{style-loader,css-loader}, which are installed via the npm install command running inside of dependencies.

dockerized-nodejs-shared-dependencies's People

Contributors

knksmith57 avatar

Watchers

 avatar  avatar

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.