Skip to content

Commit

Permalink
Always install npm dependencies during build
Browse files Browse the repository at this point in the history
Some node dependencies, such as `node-sass`, are platform-specific - mounting `node_modules` leads to the Docker build using missing the correct platform dependencies.

See webpack-contrib/sass-loader#563 (comment)
  • Loading branch information
bobheadxi committed May 21, 2018
1 parent b048567 commit 8c11f68
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ client

# Dependencies
bin
daemon/web/node_modules
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ ENV BUILD_HOME=/go/src/github.com/ubclaunchpad/inertia/daemon/web
ADD ./daemon/web ${BUILD_HOME}
WORKDIR ${BUILD_HOME}
# Build and minify client.
RUN if [ ! -d "node_modules" ]; then \
npm install --production; \
fi
RUN npm install --production
RUN npm run build

### Part 2 - Building the Inertia daemon
Expand Down

0 comments on commit 8c11f68

Please sign in to comment.