Skip to content

Instantly share code, notes, and snippets.

@GulajavaMinistudio
Forked from RinatMullayanov/Dockerfile
Created November 27, 2019 15:43
Show Gist options
  • Save GulajavaMinistudio/ceb4dfafa0d8da62291481bbb2799034 to your computer and use it in GitHub Desktop.
Save GulajavaMinistudio/ceb4dfafa0d8da62291481bbb2799034 to your computer and use it in GitHub Desktop.
Ubuntu Node.js Dockerfile
#
# Ubuntu Node.js Dockerfile
#
# https://github.com/dockerfile/ubuntu/blob/master/Dockerfile
# https://docs.docker.com/examples/nodejs_web_app/
#
# Pull base image.
FROM ubuntu:14.04
# Install Node.js
RUN apt-get install --yes curl
RUN curl --silent --location https://deb.nodesource.com/setup_4.x | sudo bash -
RUN apt-get install --yes nodejs
RUN apt-get install --yes build-essential
# Bundle app source
# Trouble with COPY http://stackoverflow.com/a/30405787/2926832
COPY . /src
# Install app dependencies
RUN cd /src; npm install
# Binds to port 8080
EXPOSE 8080
# Defines your runtime(define default command)
# These commands unlike RUN (they are carried out in the construction of the container) are run when the container
CMD ["node", "/src/index.js"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment