nteract / commuter

🚎 Notebook sharing hub

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Docker is crushing with some error?

DataPsycho opened this issue · comments

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 fsevents@1.2.13: 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 fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! canvas@2.6.1 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the canvas@2.6.1 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

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.

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
      # - LETSENCRYPT_EMAIL=youremail@somedomain.com
      - 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

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