Skip to content
This repository has been archived by the owner on Dec 14, 2023. It is now read-only.

Commit

Permalink
Docker/dev (#1151)
Browse files Browse the repository at this point in the history
* add dev dockerfile
  • Loading branch information
butlerx authored and Wardormeur committed Jul 31, 2017
1 parent 237eecb commit d540e4b
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
.git
.gitignore
*.md
Dockerfile
*Dockerfile
*.sh
!docker-entrypoint.sh
deploy
test
example
Expand Down
8 changes: 8 additions & 0 deletions .nodemonignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
web/.build/* # Build folder
web/public/* # ignore all public resources
.[^.]* # any hidden (dot) files
*.md # Markdown files
*.css # CSS files
test # test files
node_modules # dependencies
*.yml # yml files
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ RUN apk add --update git make gcc g++ python && \
mkdir -p /usr/src/app
WORKDIR /usr/src/app
ADD . /usr/src/app/
ENV DEP_VERSION=latest
RUN npm install && \
npm install cp-zen-frontend@$DEP_VERSION cp-translations@$DEP_VERSION && \
node_modules/.bin/bower install --allow-root && \
npm run lint-lib && \
npm run gulp && \
Expand Down
10 changes: 10 additions & 0 deletions dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM mhart/alpine-node:0.10.48
ENV NODE_ENV development
RUN apk add --update git python build-base && \
npm install -g nodemon bower && \
mkdir -p /usr/src/app /usr/src/cp-translations /usr/src/cp-zen-frontend
WORKDIR /usr/src/app
ADD docker-entrypoint.sh /usr/src
VOLUME /usr/src/app /usr/src/cp-translations /usr/src/cp-zen-frontend
EXPOSE 8000
CMD ["/usr/src/docker-entrypoint.sh"]
13 changes: 13 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#! /usr/bin/env sh
cd /usr/src/cp-translations || exit
npm link
cd /usr/src/cp-zen-frontend || exit
npm link
cd /usr/src/app || exit
# Dont chain this command to following commands as the post install ins going to fail
npm install
npm link cp-translations && \
npm link cp-zen-frontend && \
bower install --allow-root
npm run gulp dev &
nodemon --ignore .bower service.js
2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
.pipe(gulp.dest(relativePath('./web/public/dist/')));
});

gulp.task('watch-less', ['build-less'], function(){
gulp.task('watch-less', ['build-cdf'], function(){
return gulp.watch([ relativePath('./web/public/css/**/*.less'), relativePath('./web/public/js/directives/**/*.less')], ['build-less']);
});

Expand Down
5 changes: 0 additions & 5 deletions web/.nodemonignore

This file was deleted.

0 comments on commit d540e4b

Please sign in to comment.