How to speed up container instantiation - if possible at all?

Hi guys.

Is it possible - even if not officially covered/supported - to tweak Discourse/container to start/boot faster? (outside of tweaking resources of the host |& container itself)

You can try to use multiple container files instead of a single standalone app.yml.

But let’s be honest, almost no one needs to rebuild containers frequently, right?

If you need to install plugins, it is not necessary to rebuild the container. I have unofficial ways to install plugins without rebuilding.

Do you really mean boot faster, that is, start serviing pages sooner after you restart the container? No. It just takes a while to get rails and all of the stuff up and running.

If you mean the downtime associated with rebuilding a container, the the two-container solution is what you’re looking for.

And if that’s not fast enough and you want zero downtime, then you can do stuff with a load balancer and spin up the new container while the old one continues to serve pages and then shuts down the old one after the new one is ready.

I do not (necessarily) mean rebuild.
Say one manages - as I’d prefer - the whole lot with docker

Even a docker restart of container seems to have Discourse do whole long list of things as it gets boot up — yes, that was what I was meaning — can this be tweaked/trimmed, Ruby/Rails stuff? (Why is it that every start all that gets done? Can that not persist?)

Two-container solution — what is that?
Is it two containers with relevant bits not colliding and on the same one host talking (both containers) to the same, external both pgSQL & Redis?
Or is that a zero-downtime setup?

It has to read a whole bunch of code to be ready to serve it. Have you ever booted your phone, a computer, or a modern television? It takes some time. It’s exactly like that. The container has a whole OS in it.

Yes. It’s separating the rails+nginx into its own container and having postgres and redis in another container (or however you want to provide redis and postgres).