-
-
Save thelebster/e822b8946b8e6e133b4a4a21ee9a03b7 to your computer and use it in GitHub Desktop.
Dockerfile for the latest node.js version running in Elastic Beanstalk docker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "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