Skip to content

CanadianClimateDataPortal/climatedata-frontend-compose

Repository files navigation

Docker compose for climatedata.ca portal

Prerequisites

  • Install docker-ce and docker-compose

Steps to run

  1. Clone the current repository, and move into its directory:
    git clone [email protected]:CanadianClimateDataPortal/climatedata-frontend-compose.git
  2. Inside the climatedata-frontend-compose/ directory, clone the climatedata-wp-theme repository, and switch to the release/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
  3. 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
  4. (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
    
  5. 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

Update docker image

Just run ./compose-wrapper.sh pull; ./compose-wrapper.sh up -d

Database cleanup

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

WordPress command line

You can run ./wp-cli to execute wp-cli inside Portal's Docker container. Example: ./wp-cli plugin list

Display PHP errors and warnings

You can enable or disable the PHP errors and warnings reporting using the following command: set-log-reporting.sh <on|off>

Outbound SMTP

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published