reactql / kit

ReactQL starter kit (use the CLI)
https://reactql.org
229 stars 38 forks source link

Docker container fails with node:alpine when calling bcrypt #114

Closed arsanjea closed 6 years ago

arsanjea commented 6 years ago

Known node:alpine bug on Google App Engine - I get a segmentation fault with a node server restart after calling: bcrypt.hash("abc@abc.com", 10)

Adding the following towards the end of Dockerfile fixes the issue (requires ephemeral packages to be kept until the following operation is completed). RUN npm rebuild bcrypt --build-from-source

kane-c commented 6 years ago

What if you modify the Dockerfile like this?

# Install everything (and clean up afterwards)
RUN apk add --no-cache --virtual .gyp \
    autoconf \
    automake \
    g++ \
    libpng-dev \
    libtool \
    make \
    nasm \
    python \
    git \
  && npm i \
  && npm rebuild bcrypt --build-from-source \
  && apk del .gyp

See also: https://github.com/kelektiv/node.bcrypt.js/issues/528#issuecomment-329975006

leebenson commented 6 years ago

You can also use the general npm rebuild --build-from-source which should re-build every binary, in case you run into this error with third-party packages.

I'll go ahead and close this since this doesn't directly impact a fresh ReactQL build, and is dependent on what is added to the project later.

arsanjea commented 6 years ago

Per the other issue, that's what I ended up doing.

------------------------------------- Jean-Marc Arsan Founder & CTO @ MoneyGoat https://www.goat.money/ 79 Madison Avenue, Suite 55 https://maps.google.com/?q=79+Madison+Avenue,+Suite+55New+York,+NY,+10016&entry=gmail&source=g New York, NY, 10016 https://maps.google.com/?q=79+Madison+Avenue,+Suite+55New+York,+NY,+10016&entry=gmail&source=g

phone: +1 (310) 435-9983 email: jm@Goat.Money

On Mon, Oct 30, 2017 at 10:52 PM, Kane notifications@github.com wrote:

What if you modify the Dockerfile like this?

Install everything (and clean up afterwards)

RUN apk add --no-cache --virtual .gyp \ autoconf \ automake \ g++ \ libpng-dev \ libtool \ make \ nasm \ python \ git \ && npm i \ && npm rebuild bcrypt --build-from-source \ && apk del .gyp

See also: kelektiv/node.bcrypt.js#528 (comment) https://github.com/kelektiv/node.bcrypt.js/issues/528#issuecomment-329975006

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/reactql/kit/issues/114#issuecomment-340644850, or mute the thread https://github.com/notifications/unsubscribe-auth/AI5CeLzCUv2LNyNRt-H_lsnEjyv2M-jhks5sxotvgaJpZM4QMEJL .