From 3473ec7a860eea935d01e89869507d7036c5b0e5 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Tue, 10 Jan 2023 17:31:36 +0100 Subject: [PATCH] Explain running job servers separately --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index e87b07e4..11d2ff80 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,24 @@ Voila! All the servers are now serving the app on port 80. If you're just runnin ## Operations +### Running job hosts separately + +If your application uses separate job running hosts, or other roles beyond the default web running, you can specify these hosts and their custom command like so: + +```yaml +servers: + web: + - xxx.xxx.xxx.xxx + - xxx.xxx.xxx.xxx + job: + hosts: + - xxx.xxx.xxx.xxx + - xxx.xxx.xxx.xxx + cmd: bin/jobs +``` + +The application will be deployed to all hosts, but only those in the `web` role will be labeled to run under traefik. If you want to run custom commands on all hosts in a role, you can use `rake mrsk:app:exec:rails CMD=about ROLES=job`. + ### Executing commands If you need to execute commands inside the Rails containers, you can use `rake mrsk:app:exec`, `rake mrsk:app:exec:once`, `rake mrsk:app:exec:rails`, and `rake mrsk:app:exec:once:rails`. Examples: