diff --git a/.gitignore b/.gitignore index fec3b64..bb5147d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ **/.tmp **/bower_components **/*.log +**/dist diff --git a/.travis.yml b/.travis.yml index 2c578cc..ccd18bd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,8 +8,11 @@ before_script: - 'cd client' - 'npm install' - 'bower install' + - 'grunt build' - 'cd ../server' - 'npm install' script: - - cd ../client && npm test - - cd ../server && npm test + - cd ../client + - npm test + - cd ../server + - npm test diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a3f1c50 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,34 @@ +# To build: +# 1. Install docker (http://docker.io) +# 2. Checkout source: git@github.com:540co/ads-bpa.git +# 3. Build container: docker build . + +FROM node:0.12.4 +MAINTAINER 540 Co LLC + +# Environment Variables +ENV SRC_PATH /src/dre +ENV CLIENT_PATH $SRC_PATH/client +ENV SERVER_PATH $SRC_PATH/server + +# App +ADD . $SRC_PATH + +# Install dependencies +WORKDIR $SRC_PATH +RUN npm install -g bower grunt-cli mocha + +# Install client dependencies +WORKDIR $CLIENT_PATH +RUN npm install; bower install --allow-root; grunt build + +# Install server dependencies +WORKDIR $SERVER_PATH +RUN npm install + +# Expose port 3000 to host +EXPOSE 3000 + +# Start server +WORKDIR $SERVER_PATH +CMD ["npm", "start"] diff --git a/client/Gruntfile.js b/client/Gruntfile.js index 6a2e179..ff76c6d 100644 --- a/client/Gruntfile.js +++ b/client/Gruntfile.js @@ -355,6 +355,11 @@ module.exports = function (grunt) { cwd: 'bower_components/bootstrap/dist', src: 'fonts/*', dest: '<%= yeoman.dist %>' + }, { + expand: true, + cwd: 'bower_components/font-awesome', + src: 'fonts/*', + dest: '<%= yeoman.dist %>' }] }, styles: { diff --git a/client/app/index.html b/client/app/index.html index 5f2c296..9366cf8 100644 --- a/client/app/index.html +++ b/client/app/index.html @@ -12,18 +12,17 @@ - + - + + - - diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..d4ddc70 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,8 @@ +web: + image: 540co/dre:latest + ports: + - "3000:3000" + links: + - mongo +mongo: + image: mongo:3.0.4 diff --git a/server/app.js b/server/app.js index edb6bbc..8e10d00 100644 --- a/server/app.js +++ b/server/app.js @@ -25,7 +25,7 @@ app.use(cookieParser()); app.use('/api', index); app.use('/api/reaction', reaction); -app.use('/', express.static(__dirname + '/../client/app')); +app.use('/', express.static(__dirname + '/../client/dist')); // catch 404 and forward to error handler app.use(function(req, res, next) { diff --git a/server/config.js b/server/config.js index a9dd0c2..ad18505 100644 --- a/server/config.js +++ b/server/config.js @@ -1,5 +1,5 @@ var config = {} -config.mongo = "mongodb://localhost:27017/"; +config.mongo = "mongodb://mongo:27017/"; module.exports = config;