diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..9fdc731 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +node_modules +dist +docker diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1478995 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,53 @@ +FROM ubuntu:trusty +MAINTAINER EverythingMe Geeks +LABEL description="Development image for the redshift-console project" + +RUN apt-get update && apt-get install -y --force-yes --no-install-recommends\ + apt-transport-https \ + build-essential \ + curl \ + ca-certificates \ + git \ + lsb-release \ + python-all \ + python-dev \ + python-pip \ + libpq-dev \ + rlwrap \ + && rm -rf /var/lib/apt/lists/*; + +RUN curl https://deb.nodesource.com/node_0.12/pool/main/n/nodejs/nodejs_0.12.7-1nodesource1~trusty1_amd64.deb > node.deb \ + && dpkg -i node.deb \ + && rm node.deb + +RUN npm install -g pangyp\ + && ln -s $(which pangyp) $(dirname $(which pangyp))/node-gyp\ + && npm cache clear\ + && node-gyp configure || echo "" + +# Allow running bower as root user +RUN echo '{ "allow_root": true }' > /root/.bowerrc + +COPY requirements.txt /app/requirements.txt +COPY package.json /app/package.json +COPY .bowerrc /app/.bowerrc +COPY redshift_console/static/bower.json /app/redshift_console/static/bower.json + +WORKDIR /app +RUN npm install -g gulp bower +RUN npm install +RUN bower install +RUN pip install -r requirements.txt + +RUN echo 'api: python -m redshift_console runserver --debug\nfe: gulp watch' > /app/Procfile +RUN pip install honcho + +VOLUME /app + +# API server +EXPOSE 5000 +# Frontend server +EXPOSE 3000 + +ENTRYPOINT ["honcho"] +CMD ["start"] diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..e908f33 --- /dev/null +++ b/Procfile @@ -0,0 +1,2 @@ +api: python -m redshift_console runserver --debug +fe: gulp watch diff --git a/gulpfile.js b/gulpfile.js index 2fc9406..8487810 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -129,11 +129,12 @@ gulp.task('extras', function () { // Watch gulp.task('watch', ['html', 'bundle'], function () { var port = process.env['PORT'] || 9001; - + browserSync({ notify: false, logPrefix: 'BS', - proxy: 'http://localhost:'+port+'/' + proxy: 'http://localhost:'+port+'/', + open: false }); gulp.watch('app/scripts/**/*.js', ['scripts', reload]);