1- # Build:
2- # docker build -t meanjs/mean .
3- #
4- # Run:
5- # docker run -it meanjs/mean
6- #
7- # Compose:
8- # docker-compose up -d
1+ FROM node:lts-slim
92
10- FROM ubuntu:latest
11- MAINTAINER WAOS Node
3+ # Create app directory
4+ WORKDIR /usr/src/app
125
13- # 80 = HTTP, 443 = HTTPS, 3000 = WAOS Node server, 35729 = livereload, 8080 = node-inspector
14- EXPOSE 80 443 3000 35729 8080
15-
16- # Set development environment as default
17- ENV NODE_ENV development
18-
19- # Install Utilities
20- RUN apt-get update -q \
21- && apt-get install -yqq \
22- curl \
23- git \
24- ssh \
25- gcc \
26- make \
27- build-essential \
28- libkrb5-dev \
29- sudo \
30- apt-utils \
31- && apt-get clean \
32- && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
33-
34- # Install nodejs
35- RUN curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
36- RUN sudo apt-get install -yq nodejs \
37- && apt-get clean \
38- && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
6+ # Install app dependencies
7+ COPY package*.json ./
8+ RUN npm install
399
40- # Install WAOS Node Prerequisites
41- RUN npm install --quiet -g gulp bower yo mocha karma-cli pm2 && npm cache clean
10+ # Bundle app source
11+ COPY . .
4212
43- RUN mkdir -p /opt/waosNode/public/lib
44- WORKDIR /opt/waosNode
45-
46- # Copies the local package.json file to the container
47- # and utilities docker container cache to not needing to rebuild
48- # and install node_modules/ everytime we build the docker, but only
49- # when the local package.json file changes.
50- # Install npm packages
51- COPY package.json /opt/waosNode/package.json
52- RUN npm install --quiet && npm cache clean
53-
54- # Install bower packages
55- COPY bower.json /opt/waosNode/bower.json
56- COPY .bowerrc /opt/waosNode/.bowerrc
57- RUN bower install --quiet --allow-root --config.interactive=false
58-
59- COPY . /opt/waosNode
13+ # Expose
14+ EXPOSE 80 443 3000 35729 8080
6015
61- # Run WAOS Node server
62- CMD npm install && npm start
16+ # Command to run the executable
17+ CMD [ "node" , "server.js" ]
0 commit comments