mojaloop / design-authority-project

This is the Issue and Decision Log for tracking mojaloop and related Designs
1 stars 2 forks source link

Investigate solution to avoid recompiling node-rkafka at each npm install both in docker and in host #57

Closed claudio-viola closed 1 year ago

claudio-viola commented 4 years ago

Request:

Decision(s):

Follow-up:

Dependencies:

Accountability:

Notes:

claudio-viola commented 4 years ago

This 'hack' could be used to at least have the cache of docker file when we just bump package version and /or update test commands... There is another possible approach which would mean 'splitting' package files. https://stackoverflow.com/questions/51110793/bumping-package-json-version-without-invalidating-docker-cache

godfreykutumela commented 3 years ago

Hi, @claudio-viola @lewisdaly @elnyry-sam-k, can you please advise regarding the status of this issue?

MichaelJBRichards commented 1 year ago

PSB: Solution is to install dependencies locally MdB: only helps with local deploys, does not help with Docker; MdB does not have this issue.

mdebarros commented 1 year ago

@pedrosousabarreto and I agree that this can be resolved as per the following Dockerfile implementation in vNext: https://github.com/mojaloop/transfers-bc/blob/main/packages/command-handler-svc/Dockerfile

We must also ensure that librdkafka dependency is used for the "run-time" image instead of the development lib version librdkafka-dev (which could be used on the Builder image - if required).

I.e. the Dockerifle must contain the following:

  1. Install the librdkafka dependency:
RUN apk add --no-cache -t librdkafka
  1. And run NPM install with the BUILD_LIBRDKAFKA=0 env parameter to skip the LIBRDKAFKA library build during the install:
RUN BUILD_LIBRDKAFKA=0 npm install
  1. Ensure that librdkafka dependency is also installed on the runtime container, and not just the Builder image.