diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..6b8710a --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +.git diff --git a/Dockerfile b/Dockerfile index 980c433..f99165b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,12 +8,22 @@ RUN apt-get update &&\ RUN npm install -g coffee-script gulp bower +WORKDIR /rootpanel + +ADD . ./ + +RUN npm install +RUN bower install --allow-root +RUN gulp build + +RUN rm /etc/nginx/sites-enabled/default +RUN sed -i "s/user www-data;/user root;/g" /etc/nginx/nginx.conf + ADD sample/nginx.conf /etc/nginx/sites-enabled/rpadmin EXPOSE 80 -WORKDIR /rootpanel CMD service nginx start &&\ service mongodb start &&\ service redis-server start &&\ - /bin/bash + npm start diff --git a/gulpfile.coffee b/gulpfile.coffee index 7ad642c..c86e68b 100644 --- a/gulpfile.coffee +++ b/gulpfile.coffee @@ -13,14 +13,13 @@ minifyCss = require 'gulp-minify-css' bowerFiles = require 'main-bower-files' runSequence = require 'run-sequence' -gulp.task 'install:bower', shell.task 'bower install' - gulp.task 'clean', -> del 'public/*' gulp.task 'vendor:styles', -> gulp.src bowerFiles() - .pipe filter '*.css' + .pipe filter '*.less' + .pipe less() .pipe concat 'vendor.css' .pipe minifyCss() .pipe gulp.dest 'public/vendor' @@ -40,7 +39,6 @@ gulp.task 'vendor:fonts', -> gulp.task 'build:vendor', -> runSequence [ - 'install:bower' 'clean' ], [ 'vendor:styles' diff --git a/package.json b/package.json index f5e0065..1a985af 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ ], "main": "core", "scripts": { - "prepushlish": "gulp build", + "prepushlish": "bower install && gulp build", "start": "coffee app.coffee", "test": "mocha --compilers coffee:coffee-script/register --require test/env --recursive core/test", "docker-build": "docker build -t=jysperm/rootpanel .",