- Install docker-ce and docker-compose
- Clone the current repository, and move into its directory:
git clone [email protected]:CanadianClimateDataPortal/climatedata-frontend-compose.git
- Inside the
climatedata-frontend-compose/
directory, clone the climatedata-wp-theme repository, and switch to therelease/v1.x
branch:cd climatedata-frontend-compose git clone [email protected]:CanadianClimateDataPortal/climatedata-wp-theme.git cd climatedata-wp-theme git checkout release/v1.x
- Move back to the
climatedata-frontend-compose
directory, and start the Docker containers:# Move back to the `climatedata-frontend-compose` directory cd .. # Start the Docker containers ./compose-wrapper.sh up -d
- (Optional) Add the following entry to your hosts file (/etc/hosts under Linux/macOS,
c:\windows\system32\drivers\etc under Windows). Make sure you replace the ip address with the appropriate one to
reach your Docker VM/instance. Note that this step is only required if the IP is not 127.0.0.1:
1.2.3.4 dev-en.climatedata.ca dev-fr.climatedata.ca
- Browse to https://dev-en.climatedata.ca to reach your development instance, and https://dev-en.climatedata.ca/wp-admin to access WordPress administration. Username: dev, password: climatedata
Note: Since the theme files are not included within the docker image, you can develop directly from your git clone and hit refresh in your browser to see the changes immediately
Just run ./compose-wrapper.sh pull; ./compose-wrapper.sh up -d
The database content of your development environment will persist even after pulling a more recent version
of the docker images. If you want to delete your database volume to update the content, run:
./compose-wrapper.sh down -v; ./compose-wrapper.sh up -d
You can run ./wp-cli
to execute wp-cli inside Portal's Docker container. Example: ./wp-cli plugin list
You can enable or disable the PHP errors and warnings reporting using the following command: set-log-reporting.sh <on|off>
To be able to use an anonymous outbound SMTP server to test form submissions, create a file named override.yaml with the following content (where 1.2.3.4 is the IP address of the SMTP server):
version: "3.9"
services:
portal:
extra_hosts:
- mail:1.2.3.4
To change the destination e-mail of the form submission, copy climatedata-wp-theme/climate-data-ca/default_config.php to local_config.php and update its settings.