Please read [[Docker HowTo Install]] before installing CiviCRM == Prerequisites if required '''Step 1 - Install Docker''' [[Docker HowTo Install]] '''Step 2 - Install Git''' {{{$ sudo apt-get update }}} {{{$ sudo apt-get install git }}} '''Step 3 - Create blank CiviCRM and Drupal Databases''' {{{create database civicrmtest_fresh_docker }}} {{{create database drupaltest_fresh_docker }}} == Upgrade CiviCRM using Docker Step 1. On the host machine go to directory {{{/local/docker//}}} Step 2. Go to this directory and checkout from git docker_civicrm_upgrade {{{sudo git clone https://github.com/LCBRU/docker_civicrm_upgrade.git}}} {{{sudo chmod -R 777 docker_civicrm_upgrade/}}} This will create a directory /local/docker//docker_civicrm_upgrade This docker script upgrades an existing CiviCRM installation. Step 3. The main configuration file is Dockerfile Modify the following lines in Dockerfile : {{{ENV DRUPALVERSION 7.53}}} {{{ENV CIVICRMVERSION 4.7.15}}} {{{#####################}}} {{{# select only one}}} {{{ENV ENVIRONMENT test }}} {{{#ENV ENVIRONMENT live}}} {{{#####################}}} Note the database config are in the live and test folders. Modify as necessary the files : {{{civicrm.settings.php}}} {{{settings.php}}} Step 4. Build Docker container {{{sudo docker build -t lcbruit/civicrm:v4.7.15 .}}} {{{sudo docker build --no-cache=true -t lcbruit/civicrm:v4.7.15 .}}} Ensure that the **version number** matches the actual CiviCRM version you are upgrading to. Run container {{{sudo docker run -v /share:/share -itd -p 80:80 lcbruit/civicrm:v4.7.15}}} To connect to container : {{{sudo docker ps -a}}} {{{sudo docker exec -i -t [CONTAINER ID] /bin/bash}}} Step 5. Upgrade Drupal and CiviCRM To upgrade Drupal point your browser to : {{{http://XXXXXXXXXXXXXX.xuhl-tr.nhs.uk/update.php?op=info}}} To upgrade CiviCRM point your browser to : {{{http://XXXXXXXXXXXXXX.xuhl-tr.nhs.uk/civicrm/upgrade?reset=1}}} Go to Drupal -> Modules and enable the module 'Module Missing Message Fixer' Go to Drupal -> Configuration -> Missing Module Message Fixer to remove any missing modules. Go to the url : {{{http://XXXXXXXXXXXXXX.xuhl-tr.nhs.uk/civicrm/admin/setting/path?reset=1}}} ensure that the following are set to : {{{Temporary Files Directory = /var/local/civicrm/drupal/sites/default/files/civicrm/upload/}}} {{{Image Directory = /var/local/civicrm/drupal/sites/default/files/civicrm/persist/contribute/}}} {{{Custom Files Directory = /var/local/civicrm/drupal/sites/default/files/civicrm/custom/}}} {{{Custom Template Directory = /var/local/civicrm/drupal/sites/all/lcbru_custom/civicrm_templates/}}} {{{Custom PHP Directory = /var/local/civicrm/drupal/sites/all/lcbru_custom/civicrm_php/}}} {{{Extensions Directory = /var/local/civicrm/drupal/sites/all/lcbru_custom/civicrm_extensions/}}} Go to the url : {{{http://XXXXXXXXXXXXXX.xuhl-tr.nhs.uk/civicrm/admin/setting/url?reset=1}}} ensure that the following are set to : {{{CiviCRM Resource URL = http://XXXXXXXXXXXXXX.xuhl-tr.nhs.uk/sites/all/modules/civicrm}}} {{{Image Upload URL = http://XXXXXXXXXXXXXX.xuhl-tr.nhs.uk/sites/default/files/civicrm/persist/contribute/}}} {{{Extension Resource URL = http://XXXXXXXXXXXXXX.xuhl-tr.nhs.uk/sites/all/civicrm_extensions}}} Go to the url : {{{http://XXXXXXXXXXXXXX.xuhl-tr.nhs.uk/civicrm/admin/setting/misc?reset=1}}} ensure that the following are set to : {{{Path to wkhtmltopdf executable = /usr/local/bin/wkhtmltopdf}}} Go to the url : {{{http://uhlbriccsapp07.xuhl-tr.nhs.uk/civicrm/admin/extensions?reset=1}}} Remove any extensions not required. Stop the container : {{{sudo docker ps -a}}} {{{sudo docker stop [CONTAINER ID] }}} Step 6. Set location of theme directory. Connect to your drupal database and run the following {{{select * from variable where name = 'color_antonelli_files'; }}} This give the following output {{{a:2:{i:0;s:42:"public://color/antonelli-d1bee6f5/logo.png";i:1;s:44:"public://color/antonelli-d1bee6f5/colors.css";} }}} Modify the Dockerfile as follows {{{################### }}} {{{#css location. first line is test, 2nd line is live }}} {{{ENV CSS antonelli-d1bee6f5/ }}} {{{#ENV CSS antonelli-75b84edd }}} {{{#################### }}} Rebuild you image : {{{sudo docker build -t lcbruit/civicrm:v4.7.15 .}}} {{{sudo docker build --no-cache=true -t lcbruit/civicrm:v4.7.15 .}}} Run container {{{sudo docker run -v /share:/share -itd -p 80:80 lcbruit/civicrm:v4.7.15}}} Step 7. Ensure you have set the container to start on reboot. [[Docker HowTo Auto Start Containers On Reboot]]