Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker is crushing with some error? #289

Open
MrDataPsycho opened this issue May 14, 2020 · 3 comments
Open

Docker is crushing with some error? #289

MrDataPsycho opened this issue May 14, 2020 · 3 comments

Comments

@MrDataPsycho
Copy link

Hi, I was. trying to run commuter in a docker but its crashing with the same error. I have tried different configuration of the docker file but the error is same:

Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/local/lib/node_modules/@nteract/commuter/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/usr/local/lib/node_modules/@nteract/commuter/node_modules/canvas/build/Release --napi_version=6 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/@nteract/commuter/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules/@nteract/commuter/node_modules/fork-ts-checker-webpack-plugin/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] 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/2020-05-14T16_00_35_080Z-debug.log
ERROR: Service 'commuter' failed to build: The command '/bin/sh -c npm i -g @nteract/commuter' returned a non-zero code: 1
@captainsafia
Copy link
Member

It looks like this particular issue is related to the installation of node-pre-gyp on Docker.

Installing node-pre-gym requires some build tools, like Python and make. I would recommend checking to see if your Docker image includes these tools.

@MrDataPsycho
Copy link
Author

MrDataPsycho commented May 19, 2020

Hi, @captainsafia , Here is my docker file configuration. Can you suggest what to add. I took it from some previous post and modify some of the places.

The Docker Compose:

version: '3'
services:
  commuter:
    build:
      context: '.'
      dockerfile: 'Dockerfile'
    expose:
      - "4000"
    network_mode: "bridge"
    environment:
      - NODE_ENV=production
      - HOST=0.0.0.0
      # - VIRTUAL_HOST=commuter.somedomain.com
      # - VIRTUAL_PORT=4000
      # - LETSENCRYPT_HOST=commuter.somedomain.com
      # - [email protected]
      - COMMUTER_STORAGE_BACKEND=local
      - COMMUTER_DISCOVERY_BACKEND=none
      - COMMUTER_PORT=4000
      - COMMUTER_LOCAL_STORAGE_BASEDIRECTORY=/app
      # - COMMUTER_S3_BASE_PREFIX
      # - COMMUTER_S3_PATH_DELIMITER
      # - COMMUTER_BUCKET
      # - COMMUTER_S3_KEY
      # - COMMUTER_S3_SECRET
    volumes: 
      - /opt/commuter:/app/commuter
    restart: always
    command: commuter

The Dockerfile:

FROM node:latest
# setup container for installation.
RUN mkdir /app
WORKDIR /app
ADD . /app

# run installation/ build commands.
RUN npm i -g @nteract/commuter

ENV HOST=0.0.0.0
ENV PORT=4000

EXPOSE 4000

CMD npm run start
# EXPOSE 8081

@captainsafia
Copy link
Member

You might want to check out the new PR over at #291 for some guidance on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants