# Clone Docker Repository

Before cloning the docker repository (Epic Base) ensure you have completed all the installation steps for Docker and it is fully functional.

  1. Find a suitable location on your machine to setup your development folder (Let's call it development located at C:\)
    • Suggestion is to use this folder for other docker development
    • If this is production, a different folder name is preferable
  2. Log into Bitbucket (opens new window) and navigate to the docker default repository (opens new window)
  3. Click the Clone button located on the repository and copy the command to clone the repo
    • it should look something like this: git clone https://{username}@bitbucket.org/epicphp/docker-default.git
  4. Open a terminal window and go to your development folder
  5. Paste the git clone command you got from the repo and add to the end of it docker_app and press enter
    • the command should look something like this before pressing enter:
    • git clone https://{username}@bitbucket.org/epicphp/docker-default.git docker_app
  6. Once it is completed, run cd docker_app\webapp\ && mkdir current to navigate into the repository and create the current folder where you will host your application

Why name the folder current? This allows for continuous deployment in production using zero downtime techniques. e.g. Envoyer. Zero downtime method pulls code from a repository into a new folder and then creates a symbol link to current to this new folder.

# Clone Application of Choice Repository

  1. Navigate to the repository
  2. Click the Clone button located on the repository and copy the command to clone the repo
    • it should look something like this: git clone https://{username}@bitbucket.org/etechja/{app-name}.git
    • for ACE it should look something like this: git clone https://{username}@bitbucket.org/epicphp/client-interface.git
      • Replace {username} with your Epic Bitbucket username.
  3. In your terminal, navigate to the webapp folder in the docker repository folder
  4. In your terminal, run the git clone command you have copied earlier: git clone https://{username}@bitbucket.org/etechja/{app-name}.git current
  5. Once completed, it is now time to build the docker containers to access the php container and complete your application setup

# Docker Container Setup

Using the terminal (preferably bash), navigate to the root of the docker repository folder.

You can change the ports being used for each container within the following files if they are in conflict with another port being used on your machine.

For production, change only the docker-compose.yml file found at the root of the docker repository folder and for development, change both the docker-compose.yml and docker-compose-local.yml files found at the root of the docker repository folder.

  • For development

    1. Lets start by building the docker containers ./container build:dev
    2. After the build is complete, run the following ./container start:dev

    If you have the docker set to start at window login, the containers will start up as well, so no need to re-run these commands unless you run the command to stop them.

  • For production

    1. Lets start by building the docker containers ./container build
    2. After the build is complete, run the following ./container start

    If you have the docker set to start at window login, the containers will start up as well, so no need to re-run these commands unless you run the command to stop them.

NB. In case of issues running ./container, please use bash container

# Docker Repository Containers

The Docker repository comprises of multiple containers that provide different services and operate together but independently of each other. They can be started and stopped individually and they can fail to start even when you try to start the group of containers individual containers may fail to start for different reasons so always verify that all containers are running. For ACE, these containers specifically are Apache, MySql, PHP.

The list of containers are as follows:

  1. Apache
  2. MySQL
  3. PHP
  4. Adminer (for development)
  5. Mailhog (for development)
  6. Browser (for development)

We will be doing most of our work within the PHP container.