Skip to main content

Setting Up Development Enviromnent using Docker

Prerequisites​

  1. Install Docker on your machine
  2. Have your account on project.samarth.ac.in - GitLab
  3. Install Git on your machine
  4. Gitlab/Bitbucket credentials for auth.json
  5. For windows users, enable WSL and ensure BIOS level virtualization is enabled.

Folder Structure​

  1. Create a root folder uims in the home directory.

  2. Create two folders inside the uims folder:

    - uims
    |- docker/
    |- submodules/
    1. docker - This folder will contain the base repository
    2. submodules - This folder will contain all the submodules that are being used for development

Cloning the Base Repository​

Clone the base repository into the docker folder and checkout the docker branch

git clone <repository url> docker

Cloning Submodules repositories​

Clone any submodule(s) that you wish to work on.

cd submodules
git clone <repository url>
tip

To avoid errors during cloning use SSH or use the following command for https: git clone -b <branch name> --single-branch <repository url>

Setting up Docker Environment​

  1. Go to uims/docker.

  2. Remove the version of the submodule you wish to work on from composer.json file and replace with *. example:

    //change this
    "uims/employee": "dev-new-ux",

    //to this
    "uims/employee": "*",
  3. Add the following to the top of the repositories section in the composer.json file. Replace <module directory name> with the directory name of the submodule you cloned.

    {
    "type": "path",
    "url": "../submodules/<module directory name>"
    },

Starting the Docker Environment​

  1. Open terminal/command prompt inside the uims/docker directory.

  2. Run the following command:

    docker-compose -f docker-compose.yml up -d --remove-orphans
  3. Now open the Docker Dashboard.

  4. Go to Containers. You will have a running container named docker. Expand it view all the running services.

  5. Click the actions icon next to the container named php-uims and click Open in terminal

  6. Install the required packages.

    apt update
    apt install git
  7. Finally, install the composer packages.

    php composer.phar update
  8. 🎉Congratulations🎉 Your development environment is all set. Go to http://localhost:8080 to view the application.

Shutting Down Docker​

To shut down the environment simply click the stop button in the actions column on the Docker Dashboard.