chore(tools): update docker setup to use npm ci

pull/35857/head
Valeriy 2019-04-28 21:04:22 +03:00 committed by mrugesh mohapatra
parent 5edaee4269
commit 4f1fdfdd14
6 changed files with 23 additions and 28 deletions

View File

@ -75,7 +75,7 @@
"build": "node --max_old_space_size=7168 node_modules/gatsby-cli build",
"build:workers": "node --max_old_space_size=7168 node_modules/webpack-cli --env.production --config ./webpack-workers.js --progress",
"predevelop": "npm run prebuild",
"develop": "gatsby develop",
"develop": "node --inspect=0.0.0.0:9228 node_modules/gatsby-cli develop",
"format:gatsby": "prettier-eslint --write --trailing-comma none --single-quote './gatsby-*.js'",
"format:src": "prettier-eslint --write --trailing-comma none --single-quote './src/**/*.js'",
"format:utils": "prettier-eslint --write --trailing-comma none --single-quote './utils/**/*.js'",

View File

@ -13,7 +13,7 @@
#
# If plan to make a contribution to the project then install root node_modules
# with:
# npm install --ignore-scripts
# npm ci --ignore-scripts
#
version: '3'
services:
@ -87,7 +87,7 @@ services:
db:
image: mongo:3.6
ports:
- '27017:27017'
- '27016:27017'
volumes:
- dbdata:/data/db
mailhog:

View File

@ -176,7 +176,7 @@ Each of the above commands will take a little time to complete and you should wa
Next you need to install a few npm packages outside of docker. You can skip this step if you are only running the app locally and will not use git.
```shell
npm install --ignore-scripts
npm ci --ignore-scripts
```
All of the above needs to be run only the first time you set up the local dev environment.
@ -438,25 +438,3 @@ Follow these steps:
If you are stuck, and need help, let us know by asking in the ['Contributors' category on our forum](https://www.freecodecamp.org/forum/c/contributors) or the [Contributors chat room](https://gitter.im/FreeCodeCamp/Contributors) on Gitter.
There might be an error in the console of your browser or in Bash / Terminal / Command Line that will help identify the problem.
### Troubleshooting
If the app launches but you are encountering errors with the UI itself, for example if fonts are not being loaded or if the code editor is not displaying properly, you may try the following troubleshooting steps at least once:
```shell
# We use a mono repo and have multiple components (server, client, tools, plugins, etc.)
# Use this command to clean up all dependencies in all of the components
npm run clean
# Reinstall npm packages
npm install
# Bootstrap the project
npm run bootstrap
# Seed the database
npm run seed
# Restart the application
npm run develop
```

13
libcimp_index_js.patch Normal file
View File

@ -0,0 +1,13 @@
diff --git a/index.js b/index.js
index 61bf354..c00dc03 100644
--- a/index.js
+++ b/index.js
@@ -156,7 +156,7 @@ class Installer {
)
return BB.join(
this.checkLock(),
- stat && rimraf(path.join(this.prefix, 'node_modules'))
+ stat && rimraf(path.join(this.prefix, 'node_modules/*'))
)
}).then(() => {
// This needs to happen -after- we've done checkLock()

View File

@ -10,7 +10,7 @@
"docker:clean": "docker-compose run -u root --rm freecodecamp bash -c \"rm -rf **/node_modules/* **/node_modules/..?* **/node_modules/.[!.]* node_modules/* node_modules/..?* node_modules/.[!.]*\"",
"docker:develop": "docker-compose up client api-server",
"docker:init": "docker-compose run -u root --rm freecodecamp bash change_volumes_owner.sh && docker-compose run -u root --rm client bash -c \"cd .. && bash change_volumes_owner.sh\" && docker-compose run -u root --rm api-server bash -c \"cd .. && bash change_volumes_owner.sh\"",
"docker:install": "docker-compose run --rm freecodecamp npm install",
"docker:install": "docker-compose run -u root --rm freecodecamp bash patch_npm_and_install.sh",
"docker:seed": "docker-compose run --rm freecodecamp npm run seed",
"docker:test": "docker-compose -f docker-compose.tests.yml run --rm tests bash",
"docker:test:init": "docker-compose -f docker-compose.tests.yml run -u root --rm tests bash change_volumes_owner.sh",

4
patch_npm_and_install.sh Normal file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env bash
patch /usr/local/lib/node_modules/npm/node_modules/libcipm/index.js < libcimp_index_js.patch
su node -c "npm ci"