solgenomics / breedbase_dockerfile

The Dockerfiles for breeDBase
MIT License
8 stars 8 forks source link

npm would fail to build if users can not connect to github #26

Closed billzt closed 3 years ago

billzt commented 3 years ago

In /home/production/cxgn/sgn/js, node_modules must be correctly built in order to run the server properly.

In some special instances such as in China, it is difficult to connect with github in a command-line server. Therefore npm dependencies such as @solgenomics/brapijs and BrAPI-BoxPlotter in /home/production/cxgn/sgn/js/package.json can't be built. However we can't see any warnings or errors if we simply run docker-compose up -d breedbase. It just shows everything is OK. But you can't visit http://localhost:7080

billzt commented 3 years ago

Here is a solution. After running docker-compose up -d breedbase:

  1. Enter the container bash: docker exec -it breedbase_web bash
  2. Enter the js directory: cd /home/production/cxgn/sgn/js
  3. Manally git-cloning solgenomics/brapijs and solgenomics/BrAPI-BoxPlotter using your favourite github mirror sites
  4. Edit the file package.json as:
    "dependencies": {
    "@solgenomics/brapijs": "file:./brapi-js",
    "BrAPI-BoxPlotter": "file:./BrAPI-BoxPlotter",
    "d3": "^5.9.2"
    },
  5. Run: npm run reset && ./node_modules/.bin/webpack --config build.webpack.config.js
lukasmueller commented 3 years ago

Thanks for the comment and instructions!