Skip to content

Instantly share code, notes, and snippets.

@AhmedKammorah
Created October 29, 2015 23:43
Show Gist options
  • Save AhmedKammorah/f97139c9ed980f72345b to your computer and use it in GitHub Desktop.
Save AhmedKammorah/f97139c9ed980f72345b to your computer and use it in GitHub Desktop.
Socker file for Basic Node js image
# inheret from ubuntu
FROM ubuntu:14.04
# author
MAINTAINER Ahmed Kammorah
RUN apt-get update
RUN apt-get install curl -y
# Setup with Ubuntu:
ONBUILD RUN curl --silent --location https://deb.nodesource.com/setup_4.x | sudo bash -
#Then install with Ubuntu:
ONBUILD RUN sudo apt-get install --yes nodejs
ONBUILD RUN npm install -g yo grunt-cli bower
ONBUILD RUN npm install -g generator-angular
ONBUILD RUN npm install -g generator-react-webpack
ONBUILD RUN npm install -g generator-polymer
# create dir that mange all tools and setups
ONBUILD RUN mkdir -p /app
# cd on this dir
WORKDIR /app
ONBUILD COPY package.json /app/
ONBUILD RUN npm install
ONBUILD COPY . /app
# main command when Run new container from The Image
CMD ["node"]
##Build
# docker build -f BasicNodeDockerfile -t kammorah/basic-node-image .
##Run
# docker run -ti -p 80:80 --name basic-node -v "$PWD":/app kammorah/basic-node-image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment