-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Node.js to v16 and update frontend dependencies (#519)
* Use npm audit to update npm packages * Use Node.js version 16 in Docker development also changed shell to bash We use nvm to install Node.js as nodesource distributions somehow always install Node.js 18 instead (see nodesource/distributions#1583) * Use node after installation * Split installation of Node.js to multiple RUN commands Also alias the default version If you want to see the full output during Docker build, you can use the "--progress=plain" option. * Uniy sass packages and update yarn lock * Reflect changes in production and test Dockerfiles * Add comments to Dockerfile and tighten run commands * Add sass-loader back as dependency * Switch back to old version of sass-loader This is because we still use webpacker v4 currently. We will upgrade this depenedency when we switch from @rails/webpacker to webpack in the future. * Use "-no-install-recommends" for yarn install in prod This is so that Node.js is not installed again, which would result in v18, which we don't want at the moment. * Use consistent ${} syntax in Dockerfile & fix Node path * Copy Node.js over to /usr/local This ensures that the app user can access node that was previously installed with nvm in /root/.nvm * Apply quote arguments suggestion (in code review) Co-authored-by: Christian Heusel <[email protected]> * Quote arguments in other Dockerfiles as well * Replace deprecated apt-key and improve Dockerfiles - Replaced Yarn installation with "corepack", a new binary shipped with Node.js starting with v16. This also means that Yarn is upgraded from v1 to v2 with a different CLI, e.g. we now use "yarn workspaces focus" instead of "yarn install" to install the dependencies for the workspace in the current working directory. - Update GPG key handling during PostgreSQL installation - Added some more comments to the Dockerfile - Moved copying of Node.js up in the Dockerfile More yarn-related changed in subsequent commits. * Upgrade to Yarn 2 and add packages for non-error webpack build * Copy Yarn to usr folder alongside other Node.js tooling * Activate Yarn for app user * Only copy node over to usr folder * Go back to Yarn1 and explicitly set Yarn version - Added a fix so that corepack really installs the version we want and not some other old version - with Yarn2+, building curerntly fails, so we switch back to Yarn1 and deal with an upgrade of Yarn in the future * Remove ".yarn" from .gitignore Yarn1 does not generate this folder * Remove unnecessary dependencies from package.json "unnecessary" means dependencies that were added when trying out Yarn2+ * Add back missing "--production=false" to "yarn install" * Use "ruby:3.1.4-bullseye" to have PostgreSQL available * Add missing `apt update` in dev and test Dockerfiles Co-authored-by: Christian Heusel <[email protected]> * Group `update` and `install` in one RUN statement (in prod Dockerfile) * Remove superfluous newline * Make Node.js version logging one RUN statement * Explicitly set `--production=true` during `yarn install` --------- Co-authored-by: Christian Heusel <[email protected]>
- Loading branch information
1 parent
3bccb52
commit de82635
Showing
5 changed files
with
1,983 additions
and
2,699 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.