The way we do it (we use TeamCity, but I would expect it to be similar for any build server) is to have Meteor installed on our build agent. We also have a base “Meteor app” docker image, which is just the appropriate versions of Node, Nginx (for static files), etc. The build agent checks out the source code, runs the
meteor build command, and then uses a Dockerfile via
docker build to copy the bundled Meteor app into an image based off our Meteor base image and run
npm install. I haven’t optimized the build agent yet (we’re currently just running this off our SAN with 7200 RPM drives, no SSDs or RAM drives at this point) and the builds generally take between 2 and 15 minutes depending on the size of the app, the version of Meteor, and whether or not the node_modules are cached from a previous build.
The build agent then stores the image in our local docker registry and notifies our deployment server (we use Octopus Deploy) which sets environment-specific settings and automatically deploys to our test environment, which takes 3-10 seconds. Subsequent (manually triggered) deploys to staging and production also take 3-10 seconds thanks to Docker.
It certainly takes a lot longer than our simpler projects (small node apps, wordpress sites, etc, which generally take less than 30 seconds to build), but the time yours is taking seems really high to me.