Skip to content

Commit

Permalink
Ignore all the build directories in Docker
Browse files Browse the repository at this point in the history
This allows for reproducible builds.
Also, fix Dockerfile to first build and then run tests and a typo in the entrypoint.

Thanks @BenHall for reporting the issue with the Docker build!
  • Loading branch information
akalipetis committed Dec 29, 2016
1 parent a4c958c commit 61c213f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
18 changes: 16 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,16 @@
node_modules
.git
node_modules/
*.swp
.lock-wscript
lib/
Makefile.gyp
*.Makefile
*.target.gyp.mk
*.node
example/*.log
docs/
npm-debug.log
/.idea/
.env
build/
.vscode/
.git/
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN apt-get update \
WORKDIR /usr/src/app

# Set an entrypoint, to automatically install node modules
ENTRYPOINT ["/bin/bash", "-c", "if [[ ! -d node_modules ]]; then npm install; fi; exec \"$@\";"]
ENTRYPOINT ["/bin/bash", "-c", "if [[ ! -d node_modules ]]; then npm install; fi; exec \"${@:0}\";"]
CMD ["npm", "run", "dev"]

# First, install dependencies to improve layer caching
Expand All @@ -21,4 +21,4 @@ RUN npm install
COPY . /usr/src/app

# Run the tests and build, to make sure everything is working nicely
RUN npm run test && npm run build
RUN npm run build && npm run test

0 comments on commit 61c213f

Please sign in to comment.