docker-meteor icon indicating copy to clipboard operation
docker-meteor copied to clipboard

npm install taking too long

Open kaihendry opened this issue 6 years ago • 6 comments
trafficstars

Not sure if this is related to https://github.com/CyCoreSystems/docker-meteor/issues/26

Nonetheless we have an issue where the npm i is just taking too long and exhausting the health check in a ECS deployment phase.

Are we missing a trick? https://github.com/unee-t/frontend/blob/master/AWS-docker-compose.yml

Thank you,

kaihendry avatar Feb 11 '19 11:02 kaihendry

It does take a while, but that looks pretty absurd. It's possible that one of your NPM dependencies is requiring a compilation that is just too intense for whatever instance size you are using.

Can you run the container locally without issue?

Ulexus avatar Feb 11 '19 12:02 Ulexus

Isn't it possible to sort of build it (with its dependencies) before it gets deployed?

With ECS it's pretty crucial the Docker image comes online quickly. Sorry, I am not really familiar with the way Meteor works though.

kaihendry avatar Feb 11 '19 15:02 kaihendry

It is, yes, so long as your build and deploy architectures are the same. The README has a section on this. All of my deployments use this methodology, since the npm install really does take a while, particularly on complicated sites.

Ulexus avatar Feb 12 '19 00:02 Ulexus

I noticed that even when using the Dockerfile method https://media.dev.unee-t.com/2019-02-22/buildspec.yml

It STILL wants to build fibers on start. :face_with_head_bandage:

kaihendry avatar Feb 22 '19 01:02 kaihendry

That's got to be a mismatch between build and deploy architectures or OS's. That's always (that I have seen) what spawns a rebuild like that.

I've been talking about making a multi-stage build version of this for a long time. I guess I need to just step up and do that. That will make CI pipelines much simpler, if nothing else, making it easier for people who use different architectures between dev and deploy.

Ulexus avatar Feb 22 '19 01:02 Ulexus

This is my current workaround btw https://github.com/unee-t/frontend/blob/hmlet/buildspec.yml

kaihendry avatar Feb 22 '19 02:02 kaihendry