title: Can I use environment variables to make Celery worker connect to a different worker?
body: <p>I'm starting Celery worker in the way described by the manual...</p>
  
  <pre><code>$ stoneid salimfadhley$ celery worker
  
   -------------- celery@TCR-C02X29QPJHC9.local v4.2.1 (windowlicker)
  ---- **** ----- 
  --- * ***  * -- Darwin-18.2.0-x86_64-i386-64bit 2018-11-13 14:00:20
  -- * - **** --- 
  - ** ---------- [config]
  - ** ---------- .&gt; app:         default:0x10fb4ee48 (.default.Loader)
  - ** ---------- .&gt; transport:   amqp://guest:**@localhost:5672//
  - ** ---------- .&gt; results:     disabled://
  - *** --- * --- .&gt; concurrency: 8 (prefork)
  -- ******* ---- .&gt; task events: OFF (enable -E to monitor tasks in this worker)
  --- ***** ----- 
   -------------- [queues]
                  .&gt; celery           exchange=celery(direct) key=celery
  
  
  [2018-11-13 14:00:21,065: ERROR/MainProcess] consumer: Cannot connect to amqp://guest:**@127.0.0.1:5672//: [Errno 61] Connection refused.
  Trying again in 2.00 seconds...
  </code></pre>
  
  <p>Can I provide some configuration (preferably via an environment variable) so that the worker connects to a different broker address?</p>
  
  <p>According to the manual, I can use the <strong>-b</strong> flag to specify a broker URL via a command line, and I can wrap the worker in a script which pulls the environment variable and stuffs it into the command line argument of celery worker... but can I bypass this? Is there an environment variable I can set which the worker will pick up?</p>
  
  <p>I'm actually running this inside a Docker container - the easiest way to provide this information would be as an environment variable.</p>