Update web dockerfile to use dev deps when building prod assets #985
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This branch fixes a master branch CI failure that was introduced in #976. Specifically, the
bin/docker-build-web
script is failing due to docker not being able to find dev dependencies, such as "babel-loader", when runningNODE_ENV=production yarn webpack
.The issue arises from these stages in the Dockerfile:
Calling
web setup
the first time effectively runsNODE_ENV=development yarn
, which installs the development dependencies that we need. Unfortunately, callingweb build
also callsweb setup
, and that causes us to re-run the setup withNODE_ENV=production yarn
, which removes the development dependencies that were previously installed.A different fix for this would be to modify
web build
to stop calling setup, and require that folks run the setup command explicitly, as needed. Since setup only really needs to be called when package.json changes, that would also speed up steady-state development. @grampelberg thoughts?