Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
Merge branch 'master' into fixPassportRedirect
Browse files Browse the repository at this point in the history
  • Loading branch information
Daron Jones committed Sep 9, 2016
2 parents c6ae53c + 17772fe commit fb8e902
Show file tree
Hide file tree
Showing 7 changed files with 106 additions and 86 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
bower_components
.tmp
.env
79 changes: 44 additions & 35 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,52 @@
FROM ubuntu:latest
MAINTAINER MEAN.JS

# 80 = HTTP, 443 = HTTPS, 3000 = MEAN.JS server, 35729 = livereload
EXPOSE 80 443 3000 35729

# Set development environment as default
ENV NODE_ENV development

# Install Utilities
RUN apt-get update -q
RUN apt-get install -yqq wget aptitude htop vim git traceroute dnsutils curl ssh sudo tree tcpdump nano psmisc gcc make build-essential libfreetype6 libfontconfig libkrb5-dev
RUN apt-get update -q \
&& apt-get install -yqq curl \
wget \
aptitude \
htop \
vim \
git \
traceroute \
dnsutils \
curl \
ssh \
tree \
tcpdump \
nano \
psmisc \
gcc \
make \
build-essential \
libfreetype6 \
libfontconfig \
libkrb5-dev \
ruby \
sudo \
apt-utils \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Install nodejs
RUN curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
RUN sudo apt-get install -yq 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 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

Expand All @@ -34,36 +64,15 @@ WORKDIR /opt/mean.js
# 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
COPY package.json /opt/mean.js/package.json
RUN npm install --quiet && npm cache clean

# Install bower packages
ADD bower.json /opt/mean.js/bower.json
ADD .bowerrc /opt/mean.js/.bowerrc
COPY bower.json /opt/mean.js/bower.json
COPY .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/*

# Set development environment as default
ENV NODE_ENV development

# Ports generic
EXPOSE 80:80
EXPOSE 443:443

# Port 3000 for MEAN.JS server
EXPOSE 3000:3000

# Port 5858 for node debug
EXPOSE 5858:5858

# Port 35729 for livereload
EXPOSE 35729:35729
COPY . /opt/mean.js

# Run MEAN.JS server
CMD ["npm", "start"]
65 changes: 39 additions & 26 deletions Dockerfile-production
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,49 @@
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 \
wget \
aptitude \
htop \
vim \
git \
traceroute \
dnsutils \
curl \
ssh \
tree \
tcpdump \
nano \
psmisc \
gcc \
make \
build-essential \
libfreetype6 \
libfontconfig \
libkrb5-dev \
ruby \
sudo \
apt-utils \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Install nodejs
RUN curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
RUN sudo apt-get install -yq 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 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

Expand All @@ -34,32 +62,17 @@ WORKDIR /opt/mean.js
# when the local package.json file changes.
# Install npm packages
ADD package.json /opt/mean.js/package.json
RUN npm install --quiet --production
RUN NODE_ENV=development npm install --quiet && npm cache clean

# 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/*

# 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"]
CMD ["npm","run-script","start:prod"]
12 changes: 4 additions & 8 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,12 @@ gulp.task('watch:server:run-tests', function () {
});

// CSS linting task
gulp.task('csslint', function (done) {
gulp.task('csslint', function () {
return gulp.src(defaultAssets.client.css)
.pipe(plugins.csslint('.csslintrc'))
.pipe(plugins.csslint.reporter())
.pipe(plugins.csslint.reporter(function (file) {
if (!file.csslint.errorCount) {
done();
}
}));
.pipe(plugins.csslint.formatter());
// Don't fail CSS issues yet
// .pipe(plugins.csslint.failFormatter());
});

// ESLint JS linting task
Expand Down Expand Up @@ -469,4 +466,3 @@ gulp.task('debug', function (done) {
gulp.task('prod', function (done) {
runSequence(['copyLocalEnvConfig', 'makeUploadsDir', 'templatecache'], 'build', 'env:prod', 'lint', ['nodemon', 'watch'], done);
});

1 change: 0 additions & 1 deletion modules/users/tests/server/user.server.routes.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ describe('User CRUD tests', function () {
}

agent.delete('/api/users/' + user._id)
// .send(userUpdate)
.expect(200)
.end(function (userInfoErr, userInfoRes) {
if (userInfoErr) {
Expand Down
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"grunt": "~1.0.1",
"grunt-cli": "~1.2.0",
"helmet": "~2.1.2",
"jasmine-core": "~2.4.1",
"jasmine-core": "~2.5.0",
"lodash": "~4.15.0",
"lusca": "~1.4.1",
"method-override": "~2.3.5",
Expand Down Expand Up @@ -102,24 +102,24 @@
"gulp-angular-templatecache": "~1.8.0",
"gulp-autoprefixer": "~3.1.0",
"gulp-concat": "~2.6.0",
"gulp-csslint": "~0.2.0",
"gulp-csso": "~1.1.0",
"gulp-eslint": "~2.0.0",
"gulp-csslint": "~1.0.0",
"gulp-csso": "~2.0.0",
"gulp-eslint": "~3.0.1",
"gulp-imagemin": "~2.4.0",
"gulp-istanbul": "~1.1.1",
"gulp-less": "~3.0.5",
"gulp-less": "~3.1.0",
"gulp-livereload": "~3.8.1",
"gulp-load-plugins": "~1.2.0",
"gulp-mocha": "~3.0.1",
"gulp-ng-annotate": "~1.1.0",
"gulp-ng-annotate": "~2.0.0",
"gulp-node-inspector": "~0.1.0",
"gulp-nodemon": "~2.0.6",
"gulp-protractor": "~2.1.0",
"gulp-nodemon": "~2.1.0",
"gulp-protractor": "~3.0.0",
"gulp-rename": "~1.2.2",
"gulp-sass": "~2.2.0",
"gulp-sass": "~2.3.0",
"gulp-uglify": "~1.5.2",
"gulp-util": "~3.0.7",
"imagemin-pngquant": "~4.2.0",
"imagemin-pngquant": "~5.0.0",
"istanbul": "~0.4.2",
"karma": "~0.13.21",
"karma-chrome-launcher": "~0.2.2",
Expand All @@ -132,9 +132,9 @@
"load-grunt-tasks": "~3.4.1",
"mock-fs": "~3.11.0",
"node-inspector": "~0.12.7",
"run-sequence": "~1.1.5",
"run-sequence": "~1.2.2",
"semver": "~5.3.0",
"should": "~8.2.2",
"supertest": "~1.2.0"
"should": "~11.1.0",
"supertest": "~2.0.0"
}
}
5 changes: 2 additions & 3 deletions scripts/upgrade-users-sparse-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ mongoose.connect(function (db) {

if (err) {
errors.push(err);
message = 'An error occured while removing the index "' +
_indexToRemove + '".';
message = 'An error occured while removing the index "' + _indexToRemove + '".';

if (err.message.indexOf('index not found with name') !== -1) {
message = 'Index "' + _indexToRemove + '" could not be found.' +
Expand All @@ -51,7 +50,7 @@ function reportAndExit(message) {
for (var i = 0; i < errors.length; i++) {
console.log(chalk.red(errors[i]));

if (i === errors.length -1) {
if (i === (errors.length -1) ) {
process.exit(0);
}
}
Expand Down

0 comments on commit fb8e902

Please sign in to comment.