Last active
September 2, 2016 12:27
-
-
Save raisiqueira/95ef16146fe65f17b6d01a49a37c9196 to your computer and use it in GitHub Desktop.
Dockerfile for Node APPS
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
version: '2' | |
services: | |
library: | |
build: . | |
environment: | |
NODE_ENV: production | |
ports: | |
- '3000:3000' |
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
version: '2' | |
services: | |
library: | |
build: | |
context: . | |
dockerfile: Dockerfile | |
command: node_modules/.bin/nodemon --exec npm start | |
environment: | |
NODE_ENV: development | |
ports: | |
- 3000:3000 | |
volumes: | |
- .:/home/app/library | |
- /home/app/library/node_modules |
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
FROM node:4.3.2 | |
RUN useradd --user-group --create-home --shell /bin/false app &&\ | |
npm install --global [email protected] | |
ENV HOME=/home/app | |
COPY package.json npm-shrinkwrap.json $HOME/library/ | |
RUN chown -R app:app $HOME/* | |
USER app | |
WORKDIR $HOME/library | |
RUN npm cache clean && npm install --silent --progress=false | |
USER root | |
COPY . $HOME/library | |
RUN chown -R app:app $HOME/* | |
USER app | |
CMD ["npm", "start"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment