node.JS application in docker container

I have my node.JS application running in a docker container. While most of the functioning of this setup is normal but it fails to work with kafka-node module. Exception thrown is

/app/node_modules/kafka-node/node_modules/snappy/node_modules/bindings/bindings.js:83
        throw e
        ^
Error: Module did not self-register.
    at Error (native)
    at Object.Module._extensions..node (module.js:434:18)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at bindings (/app/node_modules/kafka-node/node_modules/snappy/node_modules/bindings/bindings.js:76:44)
    at Object.<anonymous> (/app/node_modules/kafka-node/node_modules/snappy/snappy.js:2:34)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)

My Dockerfile is as follows

  • Capture the output of a program run in Docker
  • Mysql in container or different VM
  • Kill a running process like a webserver inside a Docker container without killing the container
  • Docker how to create container
  • How to enable SSL in docker with nginx hosted in Ubuntu
  • Docker, ipc resources and '--privilaged' option
  • FROM node:4
    
    RUN mkdir -p /app
    WORKDIR /app
    
    COPY package.json /app/package.json
    RUN npm cache clean
    RUN npm install
    RUN npm rebuild
    COPY . /app
    
    EXPOSE 8085
    CMD []
    
    ENTRYPOINT ["bash", "runscript.sh"]
    

    And for further information, Kafka is running on separate server. All relevant ports are opened and I can telnet successfully for checking them.

  • Concourse cant put docker image to local repo, not a vaild repository/tag
  • How to run .Net project as part of jenkins job in Docker
  • Customize mongo docker raise an error when I try to create a new user for database
  • Docker Compose with Scale and multiple linked containers
  • Tail stdout from multiple Docker containers
  • Run GUI Applications with Docker for Mac and X11 Binding
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.