Skip to content

Local development

Adam Brown edited this page Nov 8, 2023 · 29 revisions

Setup your environment

                        _______
                       | ___  o|
                       |[_-_]_ |
    ______________     |[_____]|
   |.------------.|    |[_____]|
   ||            ||    |[====o]|
   ||            ||    |[_.--_]|
   ||            ||    |[_____]|
   ||            ||    |      :|
   ||____________||    |      :|
.==.|""  ......    |.==.|      :|
|::| '-.________.-' |::||      :|
|''|  (__________)-.|''||______:|
`""`_.............._\""`______
  /:::::::::::'':::\`;'-.-.  `\
 /::=========.:.-::"\ \ \--\   \
 \`""""""""""""""""`/  \ \__)   \
  `""""""""""""""""`    '========'

Authenticate local machine to private repositories

Login to 1Password - Private Packagist and ACF Pro secrets. Get the username, token and licence key from the secrets.

Run, composer config --global --auth http-basic.repo.packagist.com <username> <token> to authenticate your machine to Private Packagist (packagist.com).

Run, composer config --global --auth http-basic.connect.advancedcustomfields.com <LICENCE KEY> <domain> to authenticate your machine to the ACF PRO private repo.

Create and install TLS certs

  1. Run brew install mkcert to install the mkcert app.
  2. Run mkdir -r /bin/certs in the root of this repository, to create a new /certs folder in the bin/ directory.
  3. In the /certs folder run mkcert hale.docker to create the certificates.
  4. Run mkcert -install to apply certificates to your mac.
  5. Make sure Dory is running Dory up.
  6. Run Make build, to build the image and pull in the new cert pem files.
  7. Go to your browser at the URL https://hale.docker

Run locally using Docker

Make sure you have the .env.local file with correct .env vars in the root of this repository

  1. Create and install local TLS certs so the site runs on https.
  2. Run Dory up from within this repository.
  3. Run make build. This builds the images required and all assets.
  4. Run make run to launch the site on https://hale.docker

Themes and Plugins.

WordPress themes and plugins are loaded as part of the Docker image build. They are pulled into the build using PHP's Composer dependancy manager. To add or remove plugins, modify the composer.json file in the root of this directory.

Clone this wiki locally