Remix.run Logo
x0x0 4 hours ago

It may be even easier to not even leave a vm in off. Using either the fly command or their api, you can kick off a one-off machine that runs an arbitrary script on boot and dies when that script ends.

yanked from my script:

    cmd = [
      "fly", "machine", "run", latest_image,
      "--app", APP_NAME,
      "--region", options[:region],
      '--vm-size', 'performance-1x',
      '--memory', options[:memory] || '2048m',
      "--entrypoint", "/rails/bin/docker-entrypoint bundle exec rake #{rake_task}",
      "--rm"
    ]
    
    system(cmd)
or a 1-1 transliteration to their api. You can of course run many of these at once.