Can anything be done to reduce Thea's installed size?

With our setup a Theia instance takes about 90 seconds to start up. The vast majority of this time is spent downloading & decompressing the docker image.

The theiaide/theia image weighs in at 357MB, which is about the same size as the custom image we’re using in productio. I’m surprised I haven’t seen more discussion about this issue, since Theia is designed to operate in the cloud.

Is there any way to reduce the overall size of the image, even theoretically? I’m also curious to hear how everyone else is deploying Theia and what your startup times are.

@bendavis I believe if you want to reduce your overall docker image size you can:

  • start with a smaller base image (such as alpine) but this will mean you need to install the proper dependencies and build tools yourself (theia-docker does this already).
  • use multi-stage builds (this helps remove unnecessary components not helpful in the final artifact)
  • build theia using --production (to remove dev_dependencies)
  • avoid using too many layers (the examples under theia-apps are meant to be easily readable for others to reference, but are not meant for production)
  • perform cleanups when possible

These items are also expressed in documentation to reduce docker image sizes and is not specific to the framework:

@vince-fugnitto We’re already doing all of these suggestions. We’re using the same Dockerfile as theia-docker (from theia-apps) with a few tweaks. The minimal theia-docker image is 357MB, and our image is not much larger at 369MB.

@bendavis if you are looking into reducing the size of theia itself, I found the following discussion:

The last comment may be the reason the size is larger, and we should think about adding mechanisms to reduce the bundle size for production. It is possible this is the case already but I do not have knowledge of it unfortunately. Perhaps others with experience such as Che or Gitpod can comment.