Git Product home page Git Product logo

docker-nodejs's Introduction

Node.js Docker Image

This is a simple node.js image that is intended to be used run a single node.js application, named app.js, from a mapped host volume folder.

The idea is that you can update your node.js app and simply restart the docker container to load the new version.

You don't need to build this base image yourself, you can pull a pre-built image from docker hub by typing: docker pull yorkshirekev/nodejs

If you want to have the container pull any dependant npm modules (rather than package them with your app), then you can simply run the image and override the node command to run npm install like so: docker run -it --rm --user 1000:1000 -v /path/to/your/node/app/folder:/nodeapp yorkshirekev/nodejs npm install

Run your app: docker run -d --user 1000:1000 -v /path/to/your/node/app/folder:/nodeapp -p 8080:8080 --name nodeapp yorkshirekev/nodejs

Two ports are exposed in the image; 8080 and 8443. These are intended to be used for http and https respectively (i.e. map them to 80 and 443 if exposing to the internet).

The --user parameter is used to ensure that the docker container can access the files mounted from your host folder. Set these to the user:group as used on your docker host. The UID/GID numbers have to be used rather than the names because the names won't match anything inside the container. 1000:1000 is user:group. Use the id command to determine your UID and GID numbers.

docker-nodejs's People

Contributors

yorkshirekev 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.