Dev Docs
  • Disciple.Tools Technical Documentation
  • Theme Core
    • API - Posts
      • List of Endpoints
      • Fields Format
      • Get Post
      • Create Post
      • Update Post
      • Post Comments
      • Post Activity
      • List Query
      • Global Search
      • Posts in Typeaheads
      • Post-Sharing
      • Get Following
      • Settings
    • API - Other
      • Users
      • Locations
      • Settings
    • Hooks
      • Record Page Hooks
      • API-Hooks
      • Public settings
      • Adding menu navigation links
    • Customization
      • Fields
      • Custom Post Types
      • Post Type Modules
      • Adding Fields and Tiles.
    • Authentication
      • JWT-Authentication-for-the-mobile-app
      • Site-to-Site-Link
      • Easy-Example
    • Permissions
    • Roles and Permissions
    • Database Tables
      • Activity Table
    • Disciple.Tools Translation
    • Revisions
      • v1.0.0-dev-changes
      • v1.0
  • Hosting
    • 404 Errors on new install
    • CRON
    • Hosting on WPEngine
    • Backups
    • Single Site or MultiSite
  • Disciple.Tools Development Setup
    • LocalWP
    • Mobile App Setup
    • Unit Tests
    • Cypress Tests
    • D.T on Docker Setup
    • Gulp - CSS and JS
  • Code Contribution
    • Theme Contribution Guidelines
    • How to Correctly Contribute to the Disciple Tools Repository
    • How to Translate Your Plugin
  • Style Guide
  • Disciple.Tools Code of Conduct
Powered by GitBook
On this page
  • Contents
  • Three Choices
  • Setup Docker
  • Install Docker
  • Configure SSL
  • Configure Docker
  • Start Wordpress
  • Install Theme
  • Install Plugins
  • Enable Debugging
  • Docker Multi-site Setup

Was this helpful?

Edit on Git
  1. Disciple.Tools Development Setup

D.T on Docker Setup

PreviousCypress TestsNextGulp - CSS and JS

Last updated 3 years ago

Was this helpful?

is a container system that can be used to set up all of the infrastructure needed to run a web site. The below will setup containers locally needed to run a MySQL database and an Apache + PHP web server

All of this will be running on a Linux virtual machine in order to duplicate as close as possible the production hosting environment.

Contents

Three Choices

There are currently three sets of instructions for setting up a Disciple Tools server locally using Docker. Choose the one that suites your needs best.

  1. Prepackaged Image

  2. Video Walk-through

    The videos do not follow these instructions exactly, but it is better to use them to help understand these instructions, instead of following them by themselves.

  3. Example Template

Setup Docker

Install Docker

For Windows:

  • When you start the Docker Desktop, if necessary it will provide you with additional instructions to update WSL 2 (Windows Subsystem for Linux)

  • If the user account you commonly use does not have admin privileges, you can add it to the docker-users group so you can run docker directly without requiring “runas” (similar to “sudo” in Linux/MacOS)

    From the Computer Management app: open System Tools > Local Users and Groups > Groups, double click the "docker-users" group and from the "Add..." dialog add the desired user account.

Configure SSL

For Windows:

  • The instructions above for MacOs work if you have OpenSSL installed

  • OpenSSL is available via

  1. From command line in the project root directory (your copy of the Github repository) run:

    > openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout server.key -out server.crt
  2. Specify the Common Name as 'local.disciple.tools'. You may answer the other questions however you wish.

Configure Docker

Prepackaged Image

  1. Create a .env file and copy/paste the following, and then update the values:

    DOMAIN=mydomain
    EMAIL=noreply@mydomain
    MYSQL_USER=wordpress
    MYSQL_PASSWORD=wordpress
    MYSQL_ROOT_PASSWORD=somewordpress

    (DOMAIN value can be an IP address - e.g., 127.0.0.1 or 192.168.1.2)

Video Walk-through

Example Template

  • Download the files, or clone the repository from GitHub, to use as a template.

Start Wordpress

Warning: The configuration files were up to date the last time they were edited, but always make sure to double check what the most up to date versions of the software components are, or make certain to install mutually compatible versions.

For example, the dockerfile should have up to date version numbers for Wordpress and PHP.

  • The first line will look like:

    FROM wordpress:5.4-php7.4-apache

  1. Run docker-compose up -d from the project root directory (or npm run docker-start).

    1. The first time this is run, it will need to download all of the machine images, so it may take a little while.

    2. There will be some warning messages that can be ignored, unless Docker cannot bring the Wordpress and Mysql containers up.

  2. For Windows: You will need to add a “security exception” in your browser from its warning dialog (depending on browser).

  3. Step through the WordPress installation process.

    • Language:

    • Site Title:

    • Username:

    • Password:

    • Your Email:

    • Press “Install WordPress”

Install Theme

Install Plugins

Some production plugins are available for installation from the Extensions tab. For developement, or unlisted plugins:

    1. Follow directions on plugin page to add auth header config to .htaccess

    2. Follow directions on plugin page to add 2 values to wp-config.php

Enable Debugging

  • Edit wp-config.php to add the following values:

     define( 'WP_DEBUG', true ); // Enable WP_DEBUG mode
     define( 'WP_DEBUG_LOG', true ); // Enable Debug logging to the /wp-content/debug.log file

Docker Multi-site Setup

  1. Add the following to wp-config.php

    /* Multisite */
    define('WP_ALLOW_MULTISITE', true);
  2. Go to Tools -> Network Setup and follow on-screen directions, adding the necessary code to .htaccess and wp-config.php

  3. After changes, login again and return to wp-admin.

  4. A new My Sites item appears in the top menu. Go to My Sites -> Network Admin -> Dashboard

    • Copy disciple-tools-multisite.php into wp-content/plugins/disciple-tools-multisite

  5. Add all of the sites as you desire.

    • For each site you add, add the needed entry to your local hosts file. For example:

       127.0.0.1   site1.local.disciple.tools

is the easiest of the three to install (similar effort to setting up a environment), but it is difficult to update preinstalled plugins.

This shows how to set up for D.T. Mobile App development on a local machine, which includes setting up the Docker server environment

which these instructions were originally based on, and provides a downloadable set configuration files, which can be updated.

Install the correct Docker download for your platform

Set up the self-signed SSL certificate. (The instructions are explained in detail)

Warning: If you will be working on the Mobile app code, it when connecting to a local server, so this step is not required.

,

,

,

or

Note: Already updated dev.conf and dockerfile configuration files are available from

Site will be available on (if you add the needed hosts file mapping) or

Configure Docker according to which one of the you choose:

Download the docker-compose.yml file from into your working directory (or clone it from GitHub)

As mentioned , the works best to help understand these instructions, rather than following it alone.

These instructions were originally based on

Check for which version of Wordpress disciple-tools-theme has been tested with.>

You should be able to access the site via (if you add the needed hosts file mapping), or

Warning: When you configure WordPress from “” or “” you will have to continue to use that address or reconfigure it from the …/wp-admin/options-general.php settings page to switch.

Note: If you cannot access DT’s home page: or other pages try this:

Login to wp-admin and go to Settings > Permalinks. You don’t need to change anything, just click Save at the bottom.

(Source: section: )

NOTE: If you used the this has already been done for you. However, if you need to update the theme you must do it manually from within the container!

Go to

Download latest release:

Follow installation instructions:

NOTE: If you used the some plugins have already been installed for you. However, if you need to update a pre-installed plugin you must do it manually from within the container!

Download the latest plugin zip files from below, and install plugins using these instructions:

Download JWT Authentication for WP REST API from:

See

https://github.com/zdmc23/dt-docker
LocalWP
YouTube playlist
https://github.com/cairocoder01/dt-docker
https://docs.docker.com/get-docker/
here
Git Bash
Ubuntu for Windows
Cygwin
Chocolatey
https://github.com/cairocoder01/dt-docker
https://local.disciple.tools
https://localhost:44300
https://github.com/zdmc23/dt-docker
https://github.com/cairocoder01/dt-docker
https://github.com/DiscipleTools/disciple-tools-theme/releases/latest
https://local.disciple.tools
https://localhost:44300
http://localhost:8000
https://localhost:44300
http://localhost:8000
https://localhost:44300/contacts
https://developers.disciple.tools/
Errors on New Installation
https://github.com/DiscipleTools/disciple-tools-theme
https://github.com/DiscipleTools/disciple-tools-theme/releases/latest/download/disciple-tools-theme.zip
https://github.com/DiscipleTools/disciple-tools-theme#how-to-install
https://wordpress.org/support/article/managing-plugins/#manual-upload-via-wordpress-admin
https://github.com/DiscipleTools/disciple-tools-demo-content
https://github.com/WP-API/Basic-Auth
https://wordpress.org/plugins/jwt-authentication-for-wp-rest-api/
https://www.wpbeginner.com/glossary/multisite/
Docker
Three Choices
Setup Docker
Install Docker
Configure SSL
Configure Docker
Prepackaged Image
Video Walk-through
Example Template
Start Wordpress
Install Theme
Install Plugins
Enable Debugging
Docker Multi-site Setup
3 approaches
YouTube playlist
above
Prepackaged Image
Prepackaged Image
does not currently support Https
Configure Windows Docker Users
icon