Skip to content
This repository has been archived by the owner on Feb 1, 2019. It is now read-only.

Commit

Permalink
Merge 2068f9c into e3ef78e
Browse files Browse the repository at this point in the history
  • Loading branch information
wpears committed Oct 2, 2015
2 parents e3ef78e + 2068f9c commit 87927ff
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 53 deletions.
12 changes: 0 additions & 12 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ logs
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

Expand All @@ -32,13 +29,4 @@ desktop.ini
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
node_modules

app
config
docs
test
scripts
*.md
*.yml
LICENSE
build-docker-container.sh
run-docker-container.sh
23 changes: 16 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
FROM alpine:3.2
FROM mhart/alpine-node:0.10

ADD ./dist /var/www/hmda-pilot
COPY ./docker-files /tmp/scripts
WORKDIR /usr/local/app

# Use a custom build script instead of messy chained together RUN
# or multiple RUN statements that add bloat to the image
RUN /tmp/scripts/run.sh
COPY . .

RUN docker-files/run.sh

USER notroot

RUN docker-files/run-node.sh

USER root

RUN cp -r dist/ /var/www/hmda-pilot/

EXPOSE 80 443

ENTRYPOINT ["/entrypoint.sh"]
CMD ["nginx"]

CMD ["nginx"]
27 changes: 15 additions & 12 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,17 +289,20 @@ module.exports = function (grunt) {
// dist: {}
// },

imagemin: {
dist: {
files: [{
expand: true,
cwd: '<%= yeoman.app %>/images',
src: '{,*/}*.{png,jpg,jpeg,gif}',
dest: '<%= yeoman.dist %>/images'
}]
}
},

// Removed due to failure to build on alpine
// Currently only saves ~7kb
// Could pre-minify images when they're checked in
//
// imagemin: {
// dist: {
// files: [{
// expand: true,
// cwd: '<%= yeoman.app %>/images',
// src: '{,*/}*.{png,jpg,jpeg,gif}',
// dest: '<%= yeoman.dist %>/images'
// }]
// }
// },
svgmin: {
dist: {
files: [{
Expand Down Expand Up @@ -383,7 +386,7 @@ module.exports = function (grunt) {
],
dist: [
'copy:styles',
'imagemin',
// 'imagemin',
'svgmin'
]
},
Expand Down
7 changes: 0 additions & 7 deletions build-docker-container.sh

This file was deleted.

4 changes: 4 additions & 0 deletions docker-files/run-node.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#Install node deps and build
npm install

grunt build:docker
22 changes: 15 additions & 7 deletions docker-files/run.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
#!/bin/sh

##### add dependencies
apk --update add nginx sed
chown -R nginx:nginx /var/www
apk --update add nginx sed make gcc g++ python git

##### Move some things into place
cp -f /tmp/scripts/nginx.conf /etc/nginx
cp -f /tmp/scripts/hmda-pilot.conf.tmpl /etc/nginx
cp -f /tmp/scripts/entrypoint.sh /
cp -f /tmp/scripts/update-nginx-config.sh /etc/nginx
cp -f docker-files/nginx.conf /etc/nginx
cp -f docker-files/hmda-pilot.conf.tmpl /etc/nginx
cp -f docker-files/entrypoint.sh /
cp -f docker-files/update-nginx-config.sh /etc/nginx

##### Set permissions
mkdir -p /var/www/
chown -R nginx:nginx /var/www
adduser -S notroot
chown -R notroot /usr/local/app

##### Install global modules
npm install -g grunt-cli

##### Clean up
rm -rf /var/cache/apk/* /tmp/scripts
rm -rf /var/cache/apk/*
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
"grunt-contrib-copy": "^0.5.0",
"grunt-contrib-cssmin": "^0.9.0",
"grunt-contrib-htmlmin": "^0.3.0",
"grunt-contrib-imagemin": "^0.9.2",
"grunt-contrib-jshint": "^0.11.0",
"grunt-contrib-less": "^0.12.0",
"grunt-contrib-uglify": "^0.4.0",
Expand All @@ -69,7 +68,7 @@
"grunt-newer": "^0.7.0",
"grunt-ng-annotate": "^0.8.0",
"grunt-protractor-runner": "^2.0.0",
"grunt-replace": "^0.8.0",
"grunt-replace": "^0.11.0",
"grunt-svgmin": "^0.4.0",
"grunt-usemin": "^2.1.1",
"grunt-wiredep": "^1.7.0",
Expand Down
5 changes: 0 additions & 5 deletions run-docker-container.sh

This file was deleted.

2 changes: 1 addition & 1 deletion test/spec/modules/hmdaFilters.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ describe('Filters: hmdaFilters', function() {

Date.prototype.getMonthFormatted = function() {
var month = this.getMonth();
return month < 10 ? '0' + (month + 1) : month + 1;
return month < 9 ? '0' + (month + 1) : month + 1;
};

Date.prototype.getDateFormatted = function() {
Expand Down

0 comments on commit 87927ff

Please sign in to comment.