Docker not including custom packages


#1

I have been using the Custom Build section found here because I have added some plugins to my reaction instance:
https://docs.reactioncommerce.com/reaction-docs/master/deploying-reaction-using-docker

I have the latest version of reaction cloned to my computer 1.6.4 and created a couple plugins for my site. The docs above say to run the docker build command and then push it to your own docker repo. I push the image to my repo, pull it down to my Ec2 server, and use the run command in the docs. No matter what I try (even running the custom image locally) my plugins are never included. Running this custom build image on my local computer or Ec2 server both result in a vanilla reaction site with no modifications.

Steps:

  1. Clone latest reaction repo (1.6.4)
  2. Add my custom plugins
  3. Reaction reset -n
  4. reaction (At this point I can see my customized reaction shop locally)
  5. Run “docker build --build-arg TOOL_NODE_FLAGS=”–max-old-space-size=2048" -t mycustom . "
  6. Build finished and then I tag it and push it to my docker account.
  7. Login to Ec2 Server
  8. Pull my custom docker image
  9. Run the final command to start the image: “docker run -d
    -p 80:3000
    -e ROOT_URL=“http://”
    -e MONGO_URL=“mongodb://”
    -e REACTION_EMAIL="youradmin@yourdomain.com
    -e REACTION_USER=“admin-username”
    -e REACTION_AUTH=“admin-password”
    mydockerhubuser/mycustom:mytag"

After the last step, reaction is running but has none of my custom plugins. Is there a step I am missing or something else I have to do to add my custom plugins??


#2

Docker build fails at the end if using reaction/base:v3.0.0

bcrypt@1.0.3 install /opt/reaction/dist/bundle/programs/server/npm/node_modules/bcrypt

node-pre-gyp install --fallback-to-build

module.js:538
throw err;
^

Error: Cannot find module '…/'
at Function.Module._resolveFilename (module.js:536:15)
at Function.Module._load (module.js:466:25)
at Module.require (module.js:579:17)
at require (internal/module.js:11:18)
at Object. (/opt/reaction/dist/bundle/programs/server/npm/node_modules/.bin/node-pre-gyp:15:20)
at Module._compile (module.js:635:30)
at Object.Module._extensions…js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bcrypt@1.0.3 install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bcrypt@1.0.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-01-14T20_18_36_035Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! meteor-dev-bundle@0.0.0 install: node npm-rebuild.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the meteor-dev-bundle@0.0.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-01-14T20_18_36_384Z-debug.log
The command ‘/bin/sh -c cd $APP_SOURCE_DIR && $BUILD_SCRIPTS_DIR/install-deps.sh && $BUILD_SCRIPTS_DIR/install-node.sh && $BUILD_SCRIPTS_DIR/install-phantom.sh && $BUILD_SCRIPTS_DIR/install-mongo.sh && $BUILD_SCRIPTS_DIR/install-meteor.sh && $BUILD_SCRIPTS_DIR/build-meteor.sh && $BUILD_SCRIPTS_DIR/post-build-cleanup.sh’ returned a non-zero code: 1


#3

I tried adding my plugins to version 1.6.0 instead of 1.6.4 and I am getting the same thing:


#4

I’d be happy to take a look at this. Can you provide an example repo that reproduces this issue?


#5

As for the Error: Cannot find module '…/', that’s a known issue with Meteor’s bcrypt package. We removed it from the app specifically because of that error, so it looks like you manually installed it later.


#6

@jeremy I added you as a collab on my repo. This contains the latest reaction image along with my 2 plugins


#7

Update: Running the build command on my Ec2 server as root user eliminates the error where Meteor can’t download but I still have the Can’t find module ‘…/’ problem.


#8

See above comment on the Can’t find module ‘…/’ problem.

meteor npm uninstall -S bcrypt

#9

For future reference, this issue tracked/resolved here: