Slow deploys of meteor apps are not a fatality

I've been developing a meteor app since 2015 now, and the production deployments have always been quite slow, around 15 minutes.

It used to be because heroku was taking its sweet time. Heroku got too slow and too expensive quite quickly though, and I switched to https://cloud.digitalocean.com + https://meteor-up.com/

My upload speed then became the bottleneck, because I lived in the countryside, where DSL is the only option. So I made sure that my CI runner (first circle CI, then github CI) would do the upload of the bundled app for me.

However, the CI workers you get for free aren't the fastest, they just can't compete with my desktop workstation on any criteria. I now also have fiber, and so the upload speed is no longer a problem. I've switched to running meteor up locally, with great success.

I can now deploy my app in 2 minutes, and by setting the correct meteor up flags, I barely get 10 seconds of downtime after each deploy. It saves me all the trouble that comes with load balancing and rolling deploys when they go wrong.

As a bonus, I can also tag the commit I just deployed with the current date, to be able to easily rollback to a previous version.

I've noticed that deploying to my staging instance is faster than the production one. It's not a big difference, something like two minutes vs two minutes twenty. My staging server is on Hetzner, so I guess my production will go there soon too.

Here's the production mup.js config, by the way

module.exports = {
  servers: {
    one: {
    	// my server public ip
      host: '46.101.232.182',
      username: '***',
      pem: '~/.ssh/***'
    }
  },
  app: {
    name: 'ciboulette',
    path: '../',
    servers: {
      one: {}
    },
    deployCheckWaitTime: 300,
    buildOptions: {
      serverOnly: true
    },
    env: {
      ROOT_URL: 'https://app.ciboulette.net',
      MONGO_URL: 'mongodb://mongodb/meteor',
      MONGO_OPLOG_URL: 'mongodb://mongodb/local',
      ENV: 'PRODUCTION',
      TZ: 'Europe/Paris'
    },
    docker: {
      image: 'zodern/meteor:root',
      prepareBundle: true,
      useBuildKit: true,
      stopAppDuringPrepareBundle: false
    },
    enableUploadProgressBar: true
  },
  mongo: {
    version: '6.0.3',
    servers: {
      one: {}
    }
  }
  , hooks: {
    'pre.deploy': {
      localCommand: 'npm run build'
    },
    'post.deploy': {
      localCommand: 'git tag -f $(date +%Y-%m-%d)'
    }
  }
};