From 180d0383f319a1e6f1ee7b67b86008623e97939f Mon Sep 17 00:00:00 2001 From: FedeG Date: Wed, 7 Sep 2016 19:40:24 -0300 Subject: [PATCH] Fix(#1468) - Fix(#1453) - Corrected SYNTAX some fixes for production and fix this bug #1453 --- Dockerfile-production | 68 ++++++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 30 deletions(-) diff --git a/Dockerfile-production b/Dockerfile-production index 9946bf844d..26c5081f03 100644 --- a/Dockerfile-production +++ b/Dockerfile-production @@ -10,56 +10,64 @@ FROM ubuntu:latest MAINTAINER MEAN.JS +# 80 = HTTP, 443 = HTTPS, 3000 = MEAN.JS server, 35729 = livereload +EXPOSE 80 443 3000 35729 + # Install Utilities -RUN apt-get update -q && apt-get install -yqq aptitude git traceroute dnsutils tree tcpdump psmisc gcc make build-essential libfreetype6 libfontconfig libkrb5-dev curl sudo +RUN apt-get update -q && apt-get install -yqq curl sudo apt-utils && apt-get clean +RUN curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash - \ + && apt-get update -q \ + && apt-get install -yqq \ + wget \ + aptitude \ + htop \ + vim \ + git \ + traceroute \ + dnsutils \ + curl \ + ssh \ + tree \ + tcpdump \ + nano \ + psmisc \ + gcc \ + make \ + build-essential \ + libfreetype6 \ + libfontconfig \ + libkrb5-dev \ + ruby \ + nodejs \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* # Install gem sass for grunt-contrib-sass -RUN apt-get install -y ruby RUN gem install sass -# Install NodeJS -RUN curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash - -RUN sudo apt-get install -yq nodejs - # Install MEAN.JS Prerequisites -RUN npm install --quiet -g grunt-cli gulp bower yo mocha karma-cli pm2 +RUN npm install --quiet -g grunt-cli gulp gulp-cli bower yo mocha karma-cli pm2 && npm cache clean -RUN mkdir /opt/mean.js RUN mkdir -p /opt/mean.js/public/lib WORKDIR /opt/mean.js +# Install bower packages +ADD bower.json /opt/mean.js/bower.json +ADD .bowerrc /opt/mean.js/.bowerrc +RUN bower install --quiet --allow-root --config.interactive=false + # Copies the local package.json file to the container # and utilities docker container cache to not needing to rebuild # and install node_modules/ everytime we build the docker, but only # when the local package.json file changes. # Install npm packages ADD package.json /opt/mean.js/package.json -RUN npm install --quiet --production - -# Install bower packages -ADD bower.json /opt/mean.js/bower.json -ADD .bowerrc /opt/mean.js/.bowerrc -RUN bower install --quiet --allow-root --config.interactive=false - -# Share local directory on the docker container -ADD . /opt/mean.js - -# Machine cleanup -RUN npm cache clean -RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* +RUN npm install --quiet && npm cache clean # Set development environment as default ENV NODE_ENV production -# Ports generic -EXPOSE 80:80 -EXPOSE 443:443 - -# Port 3000 for MEAN.JS server -EXPOSE 3000:3000 - -# Port 35729 for livereload -EXPOSE 35729:35729 +ADD . /opt/mean.js # Run MEAN.JS server CMD ["npm","run-script","start:prod"]