Skip to content
Permalink
Browse files

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

  • Loading branch information...
ValeraS authored and raisedadead committed Apr 28, 2019
1 parent 5edaee4 commit 4f1fdfdd1461e3a590cc808855926b57e1d9cb2f
@@ -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'",
@@ -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:
@@ -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.
@@ -214,7 +214,7 @@ npm run docker:develop

Your local setup automatically populates a local user in the database. Clicking the sign in button will automatically authenticate you into the local application.

However, accessing the user portfolio page is a little tricky. In development, Gatsby takes over serving the client side pages and hence you will get a 404 page for the user portfolio when working locally.
However, accessing the user portfolio page is a little tricky. In development, Gatsby takes over serving the client side pages and hence you will get a 404 page for the user portfolio when working locally.

Simply clicking the `Preview Custom 404 Page` button will forward you to the correct page.

@@ -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
```
@@ -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()
@@ -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",
@@ -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"

0 comments on commit 4f1fdfd

Please sign in to comment.
You can’t perform that action at this time.