Giter VIP home page Giter VIP logo

docker-node's Introduction

docker-node Docker Pulls

Run node from a docker container

Based on ubuntu:16.04 image, as www-data user with gosu, with some extra packages & modules.

Install

docker pull mgcrea/node:6

Extra

  • packages added:
build-essential
ffmpeg
git
graphicsmagick-imagemagick-compat
iputils-ping
jq
libav-tools
libcairo2-dev
libgif-dev
libjpeg8-dev
libkrb5-dev
libpango1.0-dev
libudev-dev
libx11-xcb1
libxcomposite1
libxdamage1
libxi6
libxtst6
libnss3
libcups2
libxss1
libxrandr2
libgconf2-4
libasound2
libatk1.0-0
libatk-bridge2.0-0
libgtk-3-0
mediainfo
nano
net-tools
openssl
rsync
screen
software-properties-common
tmux
vim
  • node_modules added:
nodemon
yarn

Usage

docker run -d --restart=always \
  -v /srv/www:/srv/www \
  -p 3000:3000 \
  --name container_name \
  mgcrea/node:6
docker-compose up -d

User/Group override

You can easily override the user/group used by the image using environment variables. Like in the following compose example:

# https://docs.docker.com/compose/yml/

node:
  container_name: node
  hostname: node
  image: mgcrea/node:6
  environment:
    - NODE_USER=www-data
    - NODE_GROUP=www-data
    - UID=33
    - GID=33
  ports:
    - "3000:3000"
  volumes:
    - ./www:/srv/www
  restart: always

NOTE: for security reasons, starting this docker container will change the permissions of all files in your www directory to a new, docker-only user. This ensures that the docker container can access the files.

Debug

Create and inspect a new instance

docker run --rm -it mgcrea/node:latest script -q -c "TERM=xterm /bin/bash" /dev/null

Inspect a running instance

docker exec -it test_node script -q -c "TERM=xterm /bin/bash" /dev/null

docker-node's People

Contributors

lionep avatar mgcrea avatar

Stargazers

 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.