Skip to content

Instantly share code, notes, and snippets.

@thelebster
Forked from james2doyle/Dockerfile
Created May 6, 2017 10:23
Show Gist options
  • Select an option

  • Save thelebster/e822b8946b8e6e133b4a4a21ee9a03b7 to your computer and use it in GitHub Desktop.

Select an option

Save thelebster/e822b8946b8e6e133b4a4a21ee9a03b7 to your computer and use it in GitHub Desktop.
Dockerfile for the latest node.js version running in Elastic Beanstalk docker
# Define image we want to build from
FROM node:7.9
# Setup the directory structure for our web app
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# Get the deps - only if not included in the deploy!!
# COPY package.json /usr/src/app/
# RUN npm install
# Modify the ENV
ENV NODE_ENV=production
ENV PORT=3000
# !! allows node server to be proxied by EB's built in nginx
ENV HOST=0.0.0.0
# Copy all our app source code sitting locally inside the docker image
COPY . /usr/src/app
# What port we want to expose
EXPOSE 3000
# Run the file referenced in "main" property
CMD ["npm", "run"]
{
"AWSEBDockerrunVersion": "1",
"Image": {
"Name": "node:7.9",
"Update": "true"
},
"Volumes": [],
"Ports": [{
"ContainerPort": "3000"
}]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment