From Wikitech

CiviProxy On Docker


As part of the email preferences work relating to this ticket, we added Civiproxy to the fundraising tech docker stack.


CiviProxy should work under docker-compose after running Here are some of the things we had to do to get it running:

Hard-code CIVICRM_SITE_KEY to docker_site_key

CiviProxy and CiviCRM need to have the same value set for their site key to let CiviProxy make requests to CiviCRM.

We set an environment variable at the top level in docker-compose.yml:

   &civicrm-site-key FR_DOCKER_CIVI_SITE_KEY=docker_site_key

The we pass it through to the civiproxy and civicrm containers:

     - *logger-host
     - *civicrm-api-key
     - *civicrm-site-key

In the civibuild wmff we pass through the environment variable to set a local env variable that is used by Civi setup so it skips generating a random key.

In our CiviProxy public config (checked into the fundraising-dev repo) we pass that env var through to the $sys_key_map:

  $sys_key_map = array('SITE_KEY' => getenv('FR_DOCKER_CIVI_SITE_KEY'));

Update `civicrm`.`contact` api_key field for admin user to 'docker-api-key'

The two systems also need to agree on an api key that can be used by CiviProxy to authorize calls to CiviCRM. We automated this setup by adding an API call to the script in civibuild's wmff config. See a screengrab of why it was necessary.


Docker stack CiviProxy Test URL


Gerrit patches

  • dev-images: (only needed if building locally):
  • Fundraising-dev:
  • CiviCRM:

Local Troubleshooting

See Fundraising/External-facing/E-mail_preference_center#Local_Troubleshooting