CyCoreSystems / docker-meteor

Dockerfile and script for running Meteor on Docker
MIT License
120 stars 73 forks source link

npm install taking too long #63

Open kaihendry opened 5 years ago

kaihendry commented 5 years ago

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,

Ulexus commented 5 years ago

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?

kaihendry commented 5 years ago

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.

Ulexus commented 5 years ago

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.

kaihendry commented 5 years ago

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:

Ulexus commented 5 years ago

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.

kaihendry commented 5 years ago

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